<!-- 活动/约课/专场详情页 -->
<template>
  <div v-if="activityInfo" :class="{'theme-market': hasMarketingActivity}">
    <div class="c-p c-w100">
      <div v-if="historyList.length > 0" @click="showHistoryDialog = true" class="c-pa c-p-t24 c-p-l12 c-bg-white c-br20 c-ww110 c-hh40 history-box c-fs22 c-fc-sblack c-flex-row c-flex-center">预约记录</div>
      <img v-if="activityInfo.poster" class="c-w100 imgCloseBig" :src="$addXossFilter(activityInfo.poster, require('@/assets/activity_defult.png'))" alt="" />
    </div>
    <!-- 营销活动倒计时 -->
    <flash-sales-time-new v-if="showMarketingBar"
      :type="activityInfo.sales || activitySales? 'isSale':activityInfo.isFriendHelper ? 'isFa' : dataInfo.bargain ? 'isBargain' : 'isCollage'"
      :price="from == 'activity' && dataInfo.collage ? dataInfo.collage.captainPrice : from == 'reservation' && activityInfo.sales ? activityInfo.sales.price : from == 'activity' && activitySales ? activitySales.price : from == 'activity' && dataInfo.bargain ? dataInfo.bargain.reservePrice : ''"
      :startTime="from == 'activity' && dataInfo.collage ? dataInfo.collage.startTime : from == 'reservation' && activityInfo.sales ? activityInfo.sales.sales.startTime : from == 'reservation' && activityInfo.isFriendHelper ? activityInfo.faStartAt : from == 'activity' && activitySales ? activitySales.sales.startTime : from == 'activity' && dataInfo.bargain ? dataInfo.bargain.startTime : ''"
      :endTime="from == 'activity' && dataInfo.collage ? dataInfo.collage.endTime : from == 'reservation' && activityInfo.sales ? activityInfo.sales.sales.endTime : from == 'reservation' && activityInfo.isFriendHelper ? activityInfo.faEndAt :from == 'activity' && activitySales ? activitySales.sales.endTime : from == 'activity' && dataInfo.bargain ? dataInfo.bargain.endTime : ''"
      :originalPrice="from == 'activity' && activityInfo.price.split('~')[0]==activityInfo.price.split('~')[1] ? activityInfo.price.split('~')[0] :activityInfo.price"
      :stock="from == 'reservation' && activityInfo.sales ? activityInfo.sales.balance: from == 'activity' && activitySales ? activitySales.balance : ''"
      :isLimit="(from == 'reservation' && activityInfo.sales && activityInfo.sales.limit == 0) || (from == 'activity' && activitySales && activitySales.limit == 0) || (from == 'activity' && dataInfo.bargain && dataInfo.bargain.isLimitStock == 2) ? false : true" :salesTag="from == 'reservation' && activityInfo.sales ? activityInfo.sales.sales.tags : from == 'activity' && activitySales ? activitySales.sales.tags : ''"
      :peopleNum="dataInfo.collage && dataInfo.collage.peopleNum"
      :stockBargain="dataInfo.bargain && dataInfo.bargain.stock"
      :bargainStatus="dataInfo.bargain && dataInfo.bargain.status"
      :isPreheat="dataInfo.bargain && dataInfo.bargain.isPreheat"
      :from="(dataInfo.collage && dataInfo.collage.collageGroupType && dataInfo.collage.collageGroupType == 2) ? 'activity' : (from == 'activity' ? 'activities' : '' )"
      @showCoupon="showCoupon = true"
      @falshSalesTime="falshSalesTime"
      @finishFlashSales="finishFlashSales"
    >
    </flash-sales-time-new>
    <!-- 多个营销活动 -->
    <div v-if="from == 'activity' && marketingNum > 1" class="c-w100 c-hh80 c-ph24 c-flex-row c-justify-sb c-aligni-center moreMarket c-fc-white" @click="handleClickMarket()">
      <i class="iconfont">&#xe735;</i>
      <p class="c-fs24">当前有多个票券正在开展营销活动，快去瞧瞧</p>
      <i class="iconfont">&#xe635;</i>
    </div>
    <!-- 新版样式 -->
    <!-- 价格 -->
    <!-- 推荐有礼 邀请支付分享 -->
    <div v-if="!$isWxAppIos() && from == 'activity' && (recType ==3 && dataInfo && activityInfo && dataInfo.recommend && isExist)" class="c-flex-row flatRecommend c-minh150" >
      <!-- 是推荐有礼 -->
      <div class="c-ph24 c-flex-row c-aligni-center c-justify-sb c-hh80 c-fc-white">
        <div class="c-flex-row c-aligni-baseline">
          <div class="c-fs34 c-fw-b c-fc-white" v-if="dataInfo && dataInfo.recommend && dataInfo.recommend.action"><span class="c-fs24 c-lh">{{'￥' | iosPriceFilter}}</span><span class="c-lh c-fs48">{{Number(dataInfo.recommend.action.recommendPrice).toFixed(2)}}<span class="c-fs18 c-pl6" v-if="dataInfo.recommend.action.isMore">起</span></span></div>
          <span class="c-lh c-fc-white c-text-decoration-through c-ml20 c-ws-n c-fs22"
            v-if="activityInfo.price.split('~')[0]!=activityInfo.price.split('~')[1] || Number(activityInfo.price.split('~')[0]) !=0">
            {{'￥' | iosPriceFilter}}{{activityInfo.price.split('~')[0]==activityInfo.price.split('~')[1] ? (Number(activityInfo.price.split('~')[0])==0?'免费':activityInfo.price.split('~')[0]) : activityInfo.price}}</span>
        </div>
      </div>
    </div>
    <div class="c-pv24" :class="isRecommend?'c-mt-66 c-br-tl40 c-br-tr40 c-bg-white':''">
      <!-- 活动&&未参加拼团活动 -->
      <div v-if="!$isWxAppIos() && from == 'activity' && !dataInfo.collage && !showSalesTime && marketingNum == 1 && !dataInfo.sales && (recType != 3 || !isExist)" class="c-ph24 c-flex-row c-aligni-center c-mv6">
        <span class="c-fw600 c-fc-xmlred" v-if="activityInfo.price && activityInfo.isShowPrice == 1">
          <span class="c-fs24 c-mt4" v-if="activityInfo.price.split('~')[0]!=activityInfo.price.split('~')[1] || Number(activityInfo.price.split('~')[0]) !=0">{{'￥' | iosPriceFilter}}</span>
          <span v-if="activityInfo.price.split('~')[0]==activityInfo.price.split('~')[1] && Number(activityInfo.price.split('~')[0]) == 0" class="c-fs30">免费</span>
          <span v-else class="c-fs48 c-lh48">{{activityInfo.price.split('~')[0]==activityInfo.price.split('~')[1] ? activityInfo.price.split('~')[0] : activityInfo.price}}</span>
        </span>
      </div>

      <div v-if="!$isWxAppIos() && from == 'activity'">
        <!-- 新价格模式活动详情页除了规格半弹窗其他都不展示积分\会员折扣信息 -->
        <discount-info class="c-mt8 c-mb20" v-if="!isiOS"
          :couponList="couponList"
          @clickShowCoupon="showCoupon = true"
        >
        </discount-info>
        <!-- <vip-entry class="c-ph24 c-mb20"
          :originPrice="originPrice"
          :styleType="2"
          :dataInfo="activityInfo"
          v-if="!$isWxAppIos() && !isiOS && showDiscount"
        ></vip-entry> -->
      </div>
      <!-- 报名时间 -->
      <div v-if="from == 'activity' && (activityInfo.status == 0 || (!collage && marketingNum == 1 && activityInfo.status == 1 && activityStatus != '已结束'))" class="c-mt10 c-mh24 c-mb24 c-p c-pz1 c-hh50 c-flex-row c-aligni-center c-fs22 c-fc-white">
        <img class="c-w100 c-hh50 c-pa c-pz-2 c-p-t0 c-p-l0" :src="require('@/assets/i/wap/activity/deadline_bg.png')" />
        <img class="c-ww108 c-h-auto c-pa c-pz-1 c-p-t12 c-p-l20" :src="require('@/assets/i/wap/activity/deadline_title.png')">
        <div v-if="from == 'activity' && activityInfo.status == 0" class="c-w100 c-pr20 c-boxSizing-b c-fs22 c-fc-white c-flex-row c-aligni-center c-justify-end">
          <span class="c-mr10">距离开始报名还剩</span>
          <cj-clocker :time="activityInfo.startAt" @on-finish="activityInfo.status == 1">
            <template v-slot="{ timeInfo }">
              <span class="c-fc-white c-fs22 c-fw600">{{timeInfo.D}}天</span>
              <span class="c-ml4">
                <span class="c-bg-white c-fc-xmlred c-fs22 c-fw600 c-pv2 c-ph4 c-br4">{{timeInfo.H}}</span>
                <span class="c-ph4 c-fw600">:</span>
                <span class="c-bg-white c-fc-xmlred c-fs22 c-fw600 c-pv2 c-ph4 c-br4">{{timeInfo.M}}</span>
                <span class="c-ph4 c-fw600">:</span>
                <span class="c-bg-white c-fc-xmlred c-fs22 c-fw600 c-pv2 c-ph4 c-br4">{{timeInfo.S}}</span>
              </span>
            </template>
          </cj-clocker>
        </div>
        <div v-if="from == 'activity' && !collage && marketingNum == 1 && activityInfo.status == 1 && activityStatus != '已结束'" class="c-w100 c-pr20 c-boxSizing-b c-fs22 c-fc-white c-flex-row c-aligni-center c-justify-end">
          <span class="c-mr10">报名截止时间还剩</span>
          <cj-clocker :time="activityInfo.endAt" @on-finish="activityInfo.status == 2">
            <template v-slot="{ timeInfo }">
              <span class="c-fc-white c-fs22 c-fw600">{{timeInfo.D}}天</span>
              <span class="c-ml4">
                <span class="c-bg-white c-fc-xmlred c-fs22 c-fw600 c-pv2 c-ph4 c-br4">{{timeInfo.H}}</span>
                <span class="c-ph4 c-fw600">:</span>
                <span class="c-bg-white c-fc-xmlred c-fs22 c-fw600 c-pv2 c-ph4 c-br4">{{timeInfo.M}}</span>
                <span class="c-ph4 c-fw600">:</span>
                <span class="c-bg-white c-fc-xmlred c-fs22 c-fw600 c-pv2 c-ph4 c-br4">{{timeInfo.S}}</span>
              </span>
            </template>
          </cj-clocker>
        </div>
      </div>
      <!-- 约课的价格 -->
      <div class="c-fs36 c-flex-row c-justify-sb c-aligni-end" v-if="!$isWxAppIos() && from == 'reservation'">
        <price-bar class="c-ph24 c-mb16"
          v-if="!(Number(activityInfo.price)==0 || activityInfo.isFriendHelper || activityInfo.sales || (!(activityInfo.isEnroll == 3 || activityInfo.isEnroll < 0)))"
          :dataInfo="activityInfo"
        >
        </price-bar>
      </div>
      <div class="c-ph24 c-flex-row c-aligni-center c-box">
        <span class="c-fs30 c-fw-b c-fc-xblack c-ww-bw c-ww-ba">{{activityInfo.name}}</span>
      </div>
      <!-- 活动签到退款 -->
      <div class="c-ph24 c-mt16" v-if="activityInfo.isRefund==1 && !(activityInfo.price.split('~')[0]==activityInfo.price.split('~')[1] && (Number(activityInfo.price.split('~')[0])==0))">
        <div class="c-fc-gray c-flex-row c-aligni-center">
          <span class="iconfont c-fs20 c-fc-sblack">&#xe7fb;</span>
          <span class="c-fs20 c-fc-gray c-pl4">所有场次签到后可退款</span>
        </div>
      </div>
      <div v-if="from == 'activity'" class="c-fs22 c-mh24 c-mt16 c-pv30 c-ph24 c-br20 c-bg-sgray">
        <div class="c-fc-xblack">
          <span class="iconfont c-fc-xblack c-fs22 c-pr8 c-mt4">&#xe680;</span>
          <span class="c-fw600">时间：</span>
          <span class="">{{activityInfo.enrollStartAt | formatStringTime}}</span>
          <span class="c-ph4">—</span>
          <span>{{activityInfo.enrollEndAt | formatStringTime}}</span>
        </div>
        <div v-if="activityInfo.isShowEnroll == 1" class="c-mt20 c-fc-xblack">
          <span class="iconfont c-fc-xblack c-fs22 c-pr8 c-mt4">&#xe62a;</span>
          <span class="c-fw600">报名：</span>
          <span class="c-flex-grow1 c-w0">已报名
            <span class="theme-fc c-fs24 c-fw600">{{getEnrollNum(activityInfo.enrollTicket, 1)}}</span>人
            <span class="c-fc-sblack">（限{{getEnrollNum(activityInfo.totalTicket, 2)}}人报名）</span>
          </span>
        </div>
        <div v-if="activityInfo.place" class="c-mt20 c-fc-xblack c-flex-row" @click="clickLocation">
          <span class="iconfont c-fc-xblack c-fs22 c-pr8 c-mt2">&#xe90f;</span>
          <span class="c-fw600">地址：</span>
          <span class="c-flex-grow1 c-w0">{{activityInfo.place}}</span>
          <span class="iconfont c-fs26 c-fc-sblack c-mt2" v-if="Number(activityInfo.lat) > 0 && Number(activityInfo.lng) > 0">&#xe635;</span>
        </div>
        <!-- 多个主办/协办方 -->
        <div class="c-mt20" v-if="activityInfo.sponsorJson && activityInfo.sponsorJson.length && from != 'sectionInfo'">
          <div v-for="(item, index) in activityInfo.sponsorJson" :key="index" :class="activityInfo.sponsorJson.length < 3 && index == (activityInfo.sponsorJson.length - 1) ? '' : 'c-mb10'" class="c-ww-bw c-ww-ba c-fc-xblack">
            <div class="c-flex-row" v-if="isShowAllSponsor || index <= 1">
              <span :class="index > 0 ? 'c-opacity0' : ''" class=" iconfont c-fc-xblack c-fs22 c-pr8 c-mt4">&#xe936;</span>
              <span class="c-lh36 c-wb-ba"><span class="c-fw600">{{item.type == 2 ? '协办方' : '主办方'}}：</span>{{item.name}}</span>
            </div>
          </div>
          <div v-if="activityInfo.sponsorJson && activityInfo.sponsorJson.length > 2" class="c-fs22 c-flex-row c-flex-center theme-fc" @click="changeShowAllSponsor">
            <span>{{isShowAllSponsor ? '收起' : '展开'}}所有主办/协办信息</span>
            <span class="iconfont c-ml10 c-fs20">{{isShowAllSponsor ? '&#xe6ab;' : '&#xe6a9;'}}</span>
          </div>
        </div>
      </div>
      <!-- 引导入群 -->
      <invite-group class="c-pr24 c-mt20"
        v-if="guideInfo != '' && from == 'activity'"
        :guideText="guideInfo.guideDesc"
        @handleShowGuidePop="handleShowGuidePop"
      >
      </invite-group>
      <!-- 开启入群引导且为被动引导方式 -->
      <div v-if="guideInfo != '' && from == 'reservation'" @click="handleShowGuidePop()" class="c-mt24 c-mh24 c-pl16 c-pr20 c-hh64 c-fs24 camp-guide-bg c-flex-row c-aligni-center">
        <img class="c-ww52 c-hh32" src="../../assets/i/wap/course/group_guide.png" alt="">
        <div class="c-w0 c-flex-grow1 c-fc-xblack c-fw600 c-pl16">{{guideInfo.guideDesc}}</div>
        <i class="iconfont c-fs40 fc-3F73F8">&#xe986;</i>
      </div>
      <div class="c-flex-row c-justify-sb">
        <div v-if="from != 'activity'" class="c-ph24 c-fs20 c-fc-gray c-mt20">
          <span v-if="from == 'reservation' && activityInfo.isShowOrder == 1" class="c-mr30">
            <span class="iconfont c-fs20 c-mr8">&#xe792;</span>{{activityInfo.orderCount}}{{ !$isWxAppIos() ? '人购买' : '人预约' }}
          </span>
          <span v-if="from == 'sectionInfo'" class="c-mr30">
            <span class="iconfont c-fs20 c-mr8">&#xe90f;</span>{{activityInfo.city}}
          </span>
          <span v-if="activityInfo.isShowEnroll == 1" class="c-mr30">
            <span class="iconfont c-fs20 c-mr8">&#xe748;</span>{{activityInfo.enrollCount}}次预约
          </span>
        </div>
        <span v-if="from == 'reservation' && companyAuth.enableDeclareModule == 0" class="c-fc-gray c-pr24">
          <i class="iconfont c-fs20 c-mr8">&#xe8b2;</i><span class="c-fs20" @click="showRefreshmentDesc = true">预约说明</span>
        </span>
      </div>
    </div>


    <bargain-rules class="c-bd-t12-f5"
      v-if="dataInfo.bargain != null && !activityInfo.hasPermission && marketingNum == 1"
      :isPreheat="dataInfo.bargain.isPreheat"
      :status="dataInfo.bargain.status"
    ></bargain-rules>

    <!-- （拼团未开始||拼团进行中）&&（可重复下单||（非待审核&&未报名成功））&& 报名人数小于总票数 -->
    <collage-persons-list :class="!collage.collageGroup && collage.status != 1 && collage.isCollageOnline != 1 ? '' : 'c-bd-t12-f5'" v-if="collage && (collage.status == 2 || collage.status == 1) && canBuy && marketingNum == 1" :collage="collage" @goCollageDetail="gcd"></collage-persons-list>
    <section>
      <!-- 活动才有的活动时间 地点等 约课主题没有 -->
      <activity-bargain :class="from != 'sectionInfo' ? 'c-bd-t12-f5' : ''" :activityName="activityInfo.name" :attendList="dataInfo.bargain.attendList" v-if="canBuy && dataInfo.bargain != null && ((dataInfo.bargain.status == 1 && dataInfo.bargain.isPreheat == 1) || dataInfo.bargain.status == 2) && dataInfo.bargain.attendList.length > 0" class="c-bd-t12-f5" @handleClickMyBargain="handleClickMyBargain" @finshTime="finshTime" @handleClickBargainActivity="handleClickBargainActivity(dataInfo.bargain, 12)"></activity-bargain>
      <activity-market v-if="marketingNum > 1 && activityInfo.status == 1 && activityInfo.remianingTickNumber > 0" class="c-bd-t12-f5" @finishMarket="finishMarket" :isPayOrder="isPayOrder" :goodsRoomId="goodsRoomId" :refereeId="refereeId" @handleClickCommonMarket="handleClickCommonMarket" :hasPermission="hasPermission" :canBuy="canBuy" :isRepeatOrder="activityInfo.isRepeatOrder" :status="activityInfo.status" :activityName="activityInfo.name" @finshTimeMarket="finshTimeMarket" :marketList="marketList" id="activityMarket" @handleClickBargainActivity="handleClickBargainActivity"></activity-market>
      <!-- 购买礼包 -->
      <div class="c-ph24 c-pv20 c-flex-row c-fs20 c-lh32 c-fc-xblack c-aligni-center c-bd-t12-f5" @click="openGifts" v-if="activityInfo && activityInfo.giftRelates && activityInfo.giftRelates.length">
        <div class="c-fs24 c-mr24 c-fc-xblack c-fw-b">赠品</div>
        <div class="c-flex-grow1">
          <div class="c-flex-row c-aligni-center c-bg-white c-justify-sb c-fs22">
            <span class="c-br4 c-inlineblack c-fs16 c-lh20 c-textAlign-c c-mr26 c-ph4 c-pv2 theme-bg-10 theme-fc">礼包</span>
            <div class="c-text-ellipsis1 c-fs22 c-lh26 c-fc-xblack"> 内含{{activityInfo.giftRelates.length}}个商品</div>
            <div class="c-flex-grow1 c-flex-row c-aligni-center c-justify-end">
              <span class="iconfont c-fs26 c-fc-gray">&#xe635;</span>
            </div>
          </div>
        </div>
      </div>
      <!-- 已报名列表lookEnrollMember -->
      <div v-if="showApplyList" class="c-bd-t12-f5 c-flex-row c-pt30 c-ph24 c-aligni-center">
        <span class="c-flex-grow1 c-fw-b c-w0 c-fs26 c-fc-xblack">{{from == 'reservation' && !$isWxAppIos() ? '已购买' : (from == 'sectionInfo' ? '已预约' : '已报名')}}{{getEnrollTotal() + '人'}}<span v-if="from == 'activity'" class="c-fc-gray c-fs22 c-fw400">（限{{getEnrollNum(activityInfo.totalTicket, 2)}}人报名）</span></span>
        <span class="c-fs20 c-fc-gray" @click="showApply=true">查看更多</span>
        <i class="iconfont c-fs26 c-fc-gray">&#xe635;</i>
      </div>
      <div v-if="showApplyList" class="c-flex-row c-ph24 c-pt26 c-pb32">
        <div v-for="(item,index) in applyList" :key='index' v-if="index<5" class="c-ww120 c-flex-column c-justify-center c-aligni-center c-p">
          <img class="c-brp50 c-ww90 c-hh90" v-lazy="item.headimgurl || require('@/assets/defult_head.png')" alt="" />
          <div v-if="from=='activity'" class="enroll-number">x{{item.number}}</div>
          <div class="c-ww120 c-fs20 c-fc-gray c-pt12 c-text-ellipsis1 c-textAlign-c">{{item.nickName==null?'未知':item.nickName}}</div>
        </div>
      </div>
    </section>
    <formEntry v-if="activityInfo.hasPermission && ((activityInfo.isRelForm == true && isShowFormlg && (activityInfo.collectPage == 3 && !activityInfo.hasFormLog) || (activityInfo.hasFormLog && activityInfo.enableEdit == 2)))"
      relType="7"  :relId="mainId"  :dataInfo="activityInfo"
      classObject="c-fs24 c-fw-b" fontSizeClass="c-fs20" iconSizeClass="c-fs14" topClass="c-bd-t12-f5"
      @goForm="goForm" ></formEntry>
    <section class="c-bd-t12-f5 c-ph24 c-bd-b1" v-if="tabList.length > 0">
      <my-small-tabbar :styleType="2" :tabList="tabList" :tabIndex="typeBar" @changeTab="changeType"></my-small-tabbar>
    </section>
    <!-- 详情介绍 编辑器内容 -->
    <course-description :independentCopy="cfg.isCopy" :independentCopyPicture="cfg.isCopyPicture" class="c-minh640 c-ph24 c-pt30 c-pb20 c-boxSizing-b" v-show="typeBar == 0" v-if="activityInfo.intro && from == 'activity'" ref="descriptions" :imgTextPreviewArr="activityInfo && activityInfo.intro ? activityInfo.intro : []" :prodType="cfrom.activity" :prodId="mainId"></course-description>
    <div v-show="typeBar == 0 && activityInfo.intro" @click="clickDesc" class="c-minh640 tinymce-text c-ph24 c-pt30 c-pb20 c-ww-bw c-ww-ba c-contexty-scroll" v-else :class="cfg.isCopy == 0 ? 'closeBig copyNot' : 'aCloseBig'" v-html="activityInfo.intro"></div>
    <loading-status-tem v-show="typeBar == 0 && !activityInfo.intro" :noDataText="'暂无介绍'" :noData="true" noDataStyle="padding: 0px" class="c-bg-white c-hh640 c-flex-column c-flex-center"></loading-status-tem>
    <!-- 关联 -->
    <active-and-column class="c-minh640" :styleType="2" v-show="typeBar == 1" v-if="relationData != ''" :soicalList="relationData.socials" :examList="relationData.exams" :speechList="relationData.speechs" :mutualList="relationData.mutuals" :datumList="relationData.datums"></active-and-column>
    <commentCom ref="commentCom" v-show="typeBar == 2" :replyPermission="hasCommentPerm" :prodType="from=='activity' ? cfrom.activity : cfrom.reservation" :prodId="mainId" :bindPhoneSetting="bindPhoneSetting" @getCommentCount="getCommentCount"></commentCom>
    <!-- 活动按钮状态判断 -->
    <div v-if="from == 'activity'">
      <div v-if="hasCommentPerm && commentInfo.isShowCommnet && typeBar == 2" @click="addComment()" class="c-pz100 c-ph24 c-bg-white c-hh88 c-aligni-center c-flex-row c-pf c-w100 c-maxw640 c-p-b0 c-pz9 c-box-shadow5">
        <div class="c-hh60 c-w0 c-flex-grow1 c-lh64 c-textAlign-c c-fs24 c-ph20 c-fc-gray c-bg-f2 c-br30"> 请输入评论内容</div>
      </div>
      <div v-else class="c-pz100 c-hh88 c-w100 c-ph24 c-flex-row c-aligni-center c-justify-sb c-fc-white c-pf c-pz99 c-p-b0 c-maxw640 c-bg-white c-fs24 c-box-shadow-bottom c-p-l0 c-p-r0 c-m-0auto">
        <div class="c-flex-row c-aligni-center c-hh64">
          <div v-if="hasCommentPerm && commentInfo.isShowCommnet" @click="addComment()" class="c-flex-column c-aligni-center c-pr24 c-justify-sb c-hh64">
            <div class="c-textAlign-c c-lh32 c-mt4 c-pt2"><span class="iconfont c-fc-sblack c-fs40 c-lh32">&#xe76a;</span></div>
            <span class="c-fc-xblack c-fs16">评论</span>
          </div>
          <!-- 活动订单 -->
          <div v-if="dataInfo.enrollInfo" @click="linkToTicketNum" class="c-flex-column c-aligni-center c-pr24 c-justify-sb c-hh64">
            <div class="c-textAlign-c c-lh32 c-mt4 c-pv2"><span class="iconfont c-fc-sblack c-fs32 c-pb4">&#xe927;</span></div>
            <span class="c-fc-xblack c-fs16">订单</span>
          </div>
        </div>
        <div v-if="activityInfo.status == 2" class="c-bg-ddd c-hh64 c-br36 c-w0 c-flex-grow1 c-flex-row c-flex-center c-fs28">
          报名已截止
        </div>
        <div v-else-if="activityStatus == '已结束'" class="c-bg-ddd c-hh64 c-br36 c-w0 c-flex-grow1 c-flex-row c-flex-center c-fs28">
          活动已结束
        </div>
        <div v-else-if="isShowUserGroupNotAllow" class="c-bg-ccc c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-br36 c-fs28">
          仅指定用户可报名
        </div>
        <template v-else-if="marketingNum == 1">
          <template v-if="(($isWxAppIos() && isCustServiceOpen) || !$isWxAppIos())">
            <div v-if="activityInfo.status == 1 && canBuy && $isWxAppIos() && activityInfo.price && Number(activityInfo.price.split('~')[1]) > 0" class="c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1 theme-bg-gradient" @click="goWxAppContact">
              咨询客服
            </div>
            <template v-else>
              <!-- 砍价信息不为空 -->
              <div class="c-flex-row c-w0 c-flex-grow1 c-hh64 c-flex-center c-pl10" v-if="activityInfo.status == 1 && canBuy && dataInfo.bargain != null && ((dataInfo.bargain.status == 1 && dataInfo.bargain.isPreheat == 1) || dataInfo.bargain.status == 2)">
                <!-- 未发起砍价 -->
                <template v-if="dataInfo.bargain.userType == 1 && activityInfo.isRepeatOrder == 0">
                  <div class="c-flex-row c-flex-center c-fc-white c-hh64 c-w100 c-fs28 c-br32 theme-bg-gradient" @click="handleClickBargainDetail(dataInfo.bargain.bargainId)">正在砍价</div>
                </template>
                <template v-if="dataInfo.bargain.userType == -1 || activityInfo.isRepeatOrder == 1">
                  <div class="c-flex-row c-justify-center c-aligni-center c-fc-white c-hh64 c-w100 c-br32"
                    :class="(dataInfo.bargain.status == 1 && dataInfo.bargain.isPreheat == 1) ? 'c-bg-d7' : 'theme-bg-gradient'" @click="handleClickBargainDetail(dataInfo.bargain.bargainId)">
                    <span class="c-fs24 c-pr10">砍价享</span>
                    <span class="c-fs24">{{'￥' | iosPriceFilter}}{{Number(dataInfo.bargain.reservePrice).toFixed(2)}}</span>
                  </div>
                </template>
              </div>
              <!-- 进行中 && 报名人数小于总票数 && （（无待审核的票 && ？）||可重复下单） && 未参加拼团且拼团非进行中 -->
              <div v-if="activityInfo.status == 1 && canBuy && !(collage != null && collage.status == 2) && !(dataInfo.bargain != null && ((dataInfo.bargain.status == 1 && dataInfo.bargain.isPreheat == 1) || dataInfo.bargain.status == 2)) && !(activitySales != null && activitySales.sales.status == 2)" :class="[hasMarketingActivity ? 'theme-bg-gradient' : 'theme-bg']" class="c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1" @click="activityBuy">
                立即报名
              </div>
              <!-- 报名进行中 && 报名人数小于总票数 && （无待审核的票且未报名成功 || 可重复下单）&& 限时购活动进行中-->
              <div v-if="activityInfo.status == 1 && canBuy && (activitySales != null && activitySales.sales.status == 2)" class="c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1 theme-bg-gradient" @click="activityBuy">
                {{$isWxAppIos() ? '咨询客服' : '立即抢购'}}
              </div>
              <!-- 报名进行中 && 报名人数小于总票数 && （无待审核的票且未报名成功 || 可重复下单）&& 拼团进行中 && （为参与拼团 || 可重复下单）-->
              <div v-if="activityInfo.status == 1 && canBuy && (collage != null && collage.status == 2 && (collage.userType == -1 || activityInfo.isRepeatOrder == 1))" class="c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1 theme-bg-gradient" @click="activityBuy">
                发起拼团
              </div>
              <!-- 拼团进行中 && 已参与拼团 && 不可重复下单 -->
              <div class="c-flex-column c-justify-sa c-aligni-end c-w0 c-flex-grow1 c-hh64 c-br32  c-mr10 theme-fc" v-if="collage != null && collage.status == 2 && collage.userType != -1 && activityInfo.isRepeatOrder == 0" @click="goCollageDetail(collage.groupId,collage.collageId)">
                拼团中...
              </div>
            </template>
          </template>
        </template>
        <template v-else>
          <div v-if="activityInfo.status == 1 && canBuy && isPayOrder == 0" class="c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1 theme-bg-gradient" @click="activityBuy">
            立即报名
          </div>
        </template>
        <div v-if="activityInfo.status == 0 && !isShowWaitCheck && !hasPermission" class="c-bg-ddd c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1">
          即将开始报名
        </div>
        <div v-if="isShowWaitCheck && activityInfo.isRepeatOrder == 0" class="c-bg-ddd c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1">
          您已报名，待审核
        </div>
        <div v-if="activityInfo.remianingTickNumber <= 0" class="c-bg-ddd c-hh64 c-flex-row c-flex-center c-br36 c-w0 c-flex-grow1">
          票已售完
        </div>
        <div v-if="activityInfo.isInvitionCard != 1" class="c-ww220 c-bg-xyellow c-ml10 c-hh64 c-br36 c-lh64 c-textAlign-c" @click="isShowShare = true">
          立即分享
        </div>
      </div>
    </div>
    <!-- 约课主题按钮状态 -->
    <div v-else-if="from == 'reservation'">
      <div v-if="hasCommentPerm && commentInfo.isShowCommnet && typeBar == 2" @click="addComment()" class="c-pz100 c-ph24 c-bg-white c-hh88 c-aligni-center c-flex-row c-pf c-w100 c-maxw640 c-p-b0 c-pz9 c-box-shadow5">
        <div class="c-hh60 c-w0 c-flex-grow1 c-lh64 c-textAlign-c c-fs24 c-ph20 c-fc-gray c-bg-f2 c-br30"> 请输入评论内容</div>
      </div>
      <div v-else class="c-pz100 c-hh80 c-flex-row c-justify-sb c-aligni-center c-w100 c-ph24 c-fc-white c-pf c-p-b0 c-maxw640 c-bg-white c-fs24 c-box-shadow-bottom">
        <div v-if="activityInfo.isFriendHelper || activityInfo.sales" class="c-flex-column c-aligni-center c-pr24 c-h c-pv16 c-justify-sb" @click="invitePoster">
          <div class="c-textAlign-c c-lh32"><img class="c-ww30" src="../../../public/i/wap/spread/poster-share.png" alt=""></div>
          <span class="c-fc-sblack c-fs16">活动海报</span>
        </div>
        <div class="c-flex-column c-justify-sb c-aligni-center c-hh60 c-pr24" @click="goMyReservationList" v-if="activityInfo.hasEnrollLog == 1 && companyAuth.enableDeclareModule == 0">
          <img src="@/assets/i/wap/reservation/reservationList.png" class="c-ww36 c-hh36 img-pe-none">
          <div class="c-fs16 c-fc-xblack">预约记录</div>
        </div>
        <div v-if="hasCommentPerm && commentInfo.isShowCommnet" @click="addComment()" class="c-flex-column c-aligni-center c-pr24 c-justify-sb c-hh64">
          <div class="c-textAlign-c c-lh32 c-mt4 c-pt2"><span class="iconfont c-fc-sblack c-fs40 c-lh32">&#xe76a;</span></div>
          <span class="c-fc-xblack c-fs16">评论</span>
        </div>
        <div v-if="(activityInfo.isEnroll == 3 || activityInfo.isEnroll < 0) && activityInfo.isUserGroup == 1 && activityInfo.isInUserGroup != true" class="c-bg-ccc c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-br36 c-fs28">
          仅指定用户可报名
        </div>
        <!-- 好友助力 -->
        <div v-else-if="activityInfo.isFriendHelper && (activityInfo.isEnroll == 3 || activityInfo.isEnroll < 0)" class="c-hh64 c-w0 c-flex-grow1 c-flex-row c-aligni-center c-justify-end">
          <div @click="goToPay" class="theme-fc c-h c-flex-row c-flex-center theme-fc theme-bd1 c-ww196 c-br32 c-mr10">{{$isWxAppIos() ? '咨询客服' : '报名上课'}}</div>
          <div class="c-h c-flex-row c-flex-center c-ww196 c-br32 c-fc-white" :class="faStatus == 2 ? 'theme-bg-gradient' : 'c-bg-d7'" @click="goHelpDetail()">灌溉领取</div>
        </div>
        <!-- 限时购 -->
        <div @click="goToPay" v-else-if="isSales && (activityInfo.isEnroll == 3 || activityInfo.isEnroll < 0)" class="c-hh64 c-w0 c-flex-grow1 c-flex-row c-flex-center c-fc-white theme-bg-gradient c-br36">
          {{$isWxAppIos() ? '咨询客服' : '立即抢购'}}
        </div>
        <div v-else class="c-flex-row c-aligni-center c-justify-end c-w0 c-flex-grow1">
          <!-- 未购买、订单已过期或已作废 预约次数已用完 -->
          <div v-if="activityInfo.enrollTimeStatus > -1 && (activityInfo.isEnroll == 3 || activityInfo.isEnroll < 0 || isShowExpireOrNoTimes || (activityInfo.enrollMode==2 && activityInfo.residueDegree ==0) || (activityInfo.reservationMode == 1 && activityInfo.residueDegree ==0))" class="c-flex-grow1 c-hh60 c-br36 c-lh60 c-textAlign-c" @click="goToPay" :class="activityInfo.enrollTimeStatus == 1 ? 'theme-bg' : 'c-bg-ddd img-pe-none'">
            {{activityInfo.enrollTimeStatus == 0 ? '即将开始报名' : activityInfo.enrollTimeStatus == 1 ? ($isWxAppIos() ? '咨询客服' : '报名上课') : '报名已截止'}}
          </div>
          <!--  -->
          <div v-else-if="isReservationCourse" class="c-flex-grow1 theme-bg c-hh60 c-br36 c-lh60 c-textAlign-c" @click="goToSectionInfo">
            预约上课
          </div>
          <div v-else-if="activityInfo.isEnroll == 1 && activityInfo.enrollMode == 1" class="c-flex-grow1 theme-bg c-hh60 c-br36 c-lh60 c-textAlign-c" @click="linkToTicketNum">
            我的预约
          </div>
        </div>
      </div>
    </div>
    <div v-else>
      <!-- 期数组件 -->
      <section-periods
        ref="periods"
        :periodsList="periodsList"
        from="sectionDetail"
        :isEnroll="activityInfo.isEnroll"
        :rtId="mainId"
        :rpId="rpId"
        :reId="reId"
        :dataInfo="activityInfo"
        :myCalendarList="myCalendarList"
        :coachList="coachList"
        :selectIndex="selectIndex"
        :selectTime="selectTime"
        :selectTimeIndex="selectTimeIndex"
        :selectCoachIndex="selectCoachIndex"
        :weeked="weeked"
        :selectCityIndex="selectCityIndex"
        :coachObject="coachObject"
        :localDate="localDate"
        @itemClick="itemClick"
        @handleClickSelectCalendar="handleClickSelectCalendar"
        @handleClickSelectTime="handleClickSelectTime"
        @handleClickCoachSelect="handleClickCoachSelect">
      </section-periods>
    </div>
    <!-- 约课有效期 购买了之后展示 聚尚美没有 -->
    <div v-if="showReservationExpireTips && typeBar != 2" :class="showDate ? 'c-ww590' : 'c-ww160'" class="c-pz10 reservation-date-box c-pf c-p-l24 c-p-b100 c-ph20  c-br36  c-text-hidden c-hh60 c-lh60 c-bg-white c-fs20 c-flex-row c-aligni-center">
      <div @click="showDate=!showDate" class="c-ww550 c-flex-row c-aligni-center c-pa">
        <div class="c-mr10">温馨提示:</div>
        <div v-show="showDate" class="c-flex-grow1 c-w0 c-text-hidden c-contextX-scroll">
          <span class="theme-fc" v-if="activityInfo.endAt == 0 && activityInfo.orderValidDAys == 0">长期可预约</span>
          <span class="theme-fc" v-if="activityInfo.endAt == 0 && activityInfo.orderValidDAys != 0">首次签到后,{{activityInfo.orderValidDAys}}天内可预约</span>
          <span class="theme-fc" v-if="activityInfo.endAt != 0">{{`${activityInfo.endAt}前`}}可预约</span>
          <span class="theme-fc" v-if="activityInfo.residueDegree != -1">,还能预约{{activityInfo.residueDegree}}次</span>
        </div>
        <i class="iconfont c-fs24" :class="showDate ? 'c-rotate180' : ''">&#xe635;</i>
      </div>
    </div>

    <!-- 约课订单过期或者作废了 预约次数已用完了 companyAuth.enableDeclareModule == 0 && (activityInfo.isEnroll < 0 || activityInfo.residueDegree == 0)-->
    <div v-if="isShowExpireOrNoTimes" class="c-ww590 c-text-hidden c-hh60 c-lh60 c-pf c-p-l24 c-ph30 c-bg-white c-p-b100 c-fs20 c-br36 c-flex-row c-justify-center c-aligni-center reservation-date-box">
      <span class="theme-fc c-w0 c-flex-grow1 c-textAlign-c" v-if="activityInfo.isEnroll <= -2">订单{{activityInfo.isEnroll == -2 ? '已作废' : '已过期'}}，请重新购买</span>
      <span class="theme-fc c-w0 c-flex-grow1 c-textAlign-c" v-else-if="activityInfo.isEnroll != 1 && activityInfo.residueDegree == 0">预约次数已用完，请重新购买</span>
    </div>
    <share-masker :isShowShare="isShowShare" v-if="isShowShare" @closeShare="isShowShare=false;"></share-masker>

    <!-- 活动才有的邀请榜 -->
    <div v-if="from == 'activity' && activityInfo.enableInviteRank == 1" @click="clickShowInvLink" :class="showInvitionCard || showMarketingCard ? (unenableTopNav ? 'c-p-t132' : 'c-p-t200') : (unenableTopNav ? 'c-p-t60' : 'c-p-t128')" class="invite-fixed-box c-hh44 c-lh44 c-pl16 c-pr20 c-fs20 c-flex-row c-aligni-center c-fc-sblack c-fw-b">
      <img class="c-ww24 c-hh24 c-mr10" src="../../assets/i/wap/activity/inviteIcon.png" alt="">
      邀请榜
    </div>
    <!-- 名单 -->
    <open-modal :openModal="showApply" @closeModal="showApply = false">
      <div class="c-bg-white c-pb32 c-ph24 c-br-tr16 c-br-tl16 c-p c-minh50vh c-maxh80vh c-flex-column" v-if="applyList">
        <div class="c-p c-bg-white">
          <div class="c-w100 c-textAlign-c c-fs28 c-pt20 c-pb18 c-fw-b c-fc-xblack">{{from == 'reservation' && !$isWxAppIos() ? '已购买' : (from == 'sectionInfo' ? '已预约' : '已报名')}}</div>
          <span @click="showApply = false" class="c-fs20 c-fc-sgray iconfont c-pa c-p-r0 c-p-b26">&#xe61b;</span>
        </div>
        <div class="c-flex-grow1 c-content-scroll" id="scrollApplyList" @scroll="onApplyScroll">
          <!-- 活动名单 -->
          <div v-if="from=='activity' || from == 'reservation' || from == 'sectionInfo'">
            <div class="c-ph24 c-pv16 c-flex-row c-justify-sb c-aligni-center" v-for="(item,index) in applyList" :key="index">
              <div class="c-flex-column c-textAlign-c c-p c-ww90">
                <img v-lazy="item.headimgurl || require('../../assets/defult_head.png')" class="c-ww70 c-hh70 c-brp50" :key="item.headimgurl" />
                <div v-if="from=='activity'" class="enroll-number">x{{item.number}}</div>
              </div>
              <div class="c-fs24 c-fc-xblack c-flex-1 c-maxw280 c-text-ellipsis1">{{item.nickName || '未知'}}</div>
              <div class="c-fs24 c-fc-gray c-lh"></div>
              <div class="c-flex-column c-textAlign-r">
                <span class="c-fs20 c-fc-gray c-mt10 c-lh">{{item.createdAt}}</span>
              </div>
            </div>
          </div>
          <div v-if="from=='activity' && activityInfo.isSummitActivity && applyList.length >= summitActivityPeopleMax" class="c-pv20 c-fs24 c-fc-sgray c-flex-row c-flex-center">仅展示前1000名报名成功用户</div>
        </div>
      </div>
    </open-modal>
    <!-- 赠送礼包 -->
    <gift-modal :tipText="giftTipText" :fromProdType="7" :hasBuy="activityInfo.hasPermission" :showGiftModal="showGifts" :fromCourseId="mainId" :prodList="activityInfo.giftRelates" @closeGift="showGifts = false"></gift-modal>
    <open-modal :openModal='showInvLink' @closeModal='showInvLink = false'>
      <img class="c-w100 c-h-auto c-mb-32" :src="require('@/assets/i/wap/activity/rank_title.png')" alt="" />
      <div class="c-p c-pz1 c-bg-white c-br-tl32 c-br-tr32 c-minh50vh c-maxh70vh c-flex-column c-aligni-center">
        <img v-if="!hasPermission && invLinkList.length <= 0" class="c-flex-shrink0 c-mt100 c-ww312 c-h-auto" :src="require('@/assets/i/wap/activity/rank_empty.png')" alt="" />
        <div v-if="invLinkList.length" class="c-flex-shrink0 c-w100 c-pt28 c-ph40 c-boxSizing-b c-flex-row c-aligni-center c-justify-sb c-fs22 c-fc-gray">
          <span>排名</span>
          <span>邀请人数</span>
        </div>
        <div class="c-flex-grow1 c-w100 c-ph40 c-boxSizing-b" :class="isRankCanApply && invLinkList.length == 0 ? '' : 'c-pb100 c-content-auto'">
          <div v-for="(rItem, rIndex) in invLinkList" :key="'rank_' + rIndex" class="c-flex-row c-aligni-center c-justify-sb c-fs22 c-fc-xblack c-pv20">
            <div class="c-flex-grow1 c-flex-row c-aligni-center">
              <div class="c-ww36 c-textAlign-r c-fc-gray">
                <img v-if="rIndex < 3" class="c-ww36 c-h-auto" :src="require('@/assets/i/wap/activity/rank_' + (rIndex + 1) + '.png')">
                <span v-else class="c-pr8">{{rIndex + 1}}</span>
              </div>
              <img class="c-ml30 c-ww60 c-hh60 c-brp50" :src="rItem.headimgurl || require('@/assets/defult_head.png')" alt="" />
              <div class="c-fs24 c-ml16">{{rItem.nickname || '--'}}</div>
            </div>
            <div class="c-flex-shrink0 c-fs28 c-fw600">{{rItem.inviteNum}}</div>
          </div>
          <div class="c-fc-gray c-w100 c-textAlign-c c-fs20 c-pt20 c-pb40" v-show="invLinkList.length == 10">————只展示前10名哦————</div>
          <loading-status-tem :noDataText="'暂无人邀请'" noDataTextClass="c-fs24 c-fc-sblack" noDataStyle="padding: 3.2rem;" :noData="hasPermission && invLinkList.length <= 0"></loading-status-tem>
          <div v-if="isRankCanApply" class="c-flex-column c-flex-center" :class="[invLinkList.length == 10 ? '' : 'c-mt60', invLinkList.length > 3 ? 'c-mb160' : 'c-mb270']">
            <div class="c-flex-shrink0 c-fs24 c-fc-sblack c-mt6">快去报名活动，参与排名吧～</div>
            <div v-if="activityInfo.status == 1 && activityInfo.remianingTickNumber > 0 && (!isShowWaitCheck && !hasPermission) && !(collage != null && collage.status == 2)" class="c-flex-shrink0 c-mt30 c-ww300 c-hh64 c-br40 c-flex-row c-flex-center c-fc-xmlred c-bd1-xmlred c-bg-xmlred-10 c-fs26" @click="activityBuy">立即报名</div>
            <div v-if="activityInfo.status == 1 && activityInfo.remianingTickNumber > 0 && (!isShowWaitCheck && !hasPermission) && (collage != null && collage.status == 2 && collage.userType == -1)" class="c-flex-shrink0 c-mt30 c-ww300 c-hh64 c-br40 c-flex-row c-flex-center c-fc-xmlred c-bd1-xmlred c-bg-xmlred-10 c-fs26 c-fw600" @click="activityBuy">立即拼团</div>
          </div>
          <!-- status：0报名未开始；1：报名进行中；2报名截止；3活动结束 -->
          <div v-else-if="!hasPermission && activityInfo.status != 1" class="c-flex-shrink0 c-flex-row c-flex-center c-fs24 c-fc-sblack c-mt6">{{activityInfo.status == 0 ? '报名未开始' : '报名已结束'}}</div>
        </div>
      </div>
      <div class="c-pf c-pz10 c-p-b0 c-p-l0 c-w100 c-hh100 c-ph40 c-boxSizing-b c-box-shadowEdu c-bg-white c-flex-row c-aligni-center c-fs24 c-fc-xblack">
        <div class="c-flex-grow1 c-flex-row c-aligni-center">
          <div class="c-ww36 c-textAlign-r c-fc-gray">
            <span v-if="!hasPermission || myInvInfo.inviteNum * 1 == 0" class="c-pr8">--</span>
            <img v-else-if="myInvInfo.rowNo < 4" class="c-ww36 c-h-auto" :src="require('@/assets/i/wap/activity/rank_' + myInvInfo.rowNo + '.png')" />
            <span v-else class="c-pr8">{{myInvInfo.rowNo}}</span>
          </div>
          <img class="c-ml24 c-ww72 c-hh72 c-brp50" :src="myInvInfo.headimgurl || require('@/assets/defult_head.png')" alt="" />
          <div v-if="myInvInfo.inviteNum * 1 > 0 || isShowWaitCheck" class="c-fs20 c-fc-gray c-ml20">我邀请人数：<span class="c-fs28 c-fw600 c-fc-xblack">{{myInvInfo.inviteNum}}</span></div>
          <div class="c-fs20 c-fc-gray c-ml20" v-else>暂未邀请好友参加活动</div>
        </div>
        <div class="c-flex-shrink0 c-ww140 c-hh52 c-br30 c-flex-row c-flex-center c-fc-white" :class="activityInfo.status != 1 ? 'c-bg-mgray' : 'c-bg-xmlred'" @click="goInvite">去邀请</div>
      </div>
    </open-modal>
    <!-- 约课预约说明 -->
    <cj-popup v-model="showRefreshmentDesc" round :closeable="true" title="预约说明" >
      <div class="c-ww480 c-pb40 c-fs24 c-fc-sblack c-ph30 c-textAlign-l">
        <div class="c-fs24 c-lh42 c-mr30 c-pb20 c-ml30">
          <!-- 首先先判断是购买前和购买后 -->
          <template v-if="activityInfo.isEnroll == 3">
            <!-- 未购买 -->
            <p v-if="activityInfo.isValid == 1">
              该约课长期有效。购买成功后您可以选择{{activityInfo.sessionRestriction == 0 ? '所有的专场' : `其中${activityInfo.sessionRestriction}个专场`}}进行预约上课，{{showTimesStr}}
            </p>
            <p v-if="activityInfo.isValid == 2">
              该约课购买后{{validAt}}内有效。有效期内您可以选择{{activityInfo.sessionRestriction == 0 ? '所有的专场' : `其中${activityInfo.sessionRestriction}个专场`}}进行预约上课，{{showTimesStr}}
            </p>
            <p v-if="activityInfo.isValid == 0">
              该约课购买后{{activityInfo.validDay}}天内有效。有效期内您可以选择{{activityInfo.sessionRestriction == 0 ? '所有的专场' : `其中${activityInfo.sessionRestriction}个专场`}}进行预约上课，{{showTimesStr}}
            </p>
            <p v-if="activityInfo.isValid == 3">
              该约课的有效预约时长首次签到后,{{activityInfo.validDay}}天内有效。有效期内可以选择{{activityInfo.sessionRestriction == 0 ? '所有的专场' : `其中${activityInfo.sessionRestriction}个专场`}}进行预约上课，{{showTimesStr}}
            </p>
          </template>
          <template v-else>
            <p v-if="activityInfo.endAt == 0 && activityInfo.orderValidDAys == 0">
              该约课长期可预约。有效期内您可以选择{{activityInfo.sessionRestriction == 0 ? '所有的专场' : `其中${activityInfo.sessionRestriction}个专场`}}进行预约上课，{{showTimesStr}}
            </p>
            <p v-if="activityInfo.endAt == 0 && activityInfo.orderValidDAys != 0">
              该约课的有效预约时长首次签到后,{{activityInfo.orderValidDAys}}天内可预约。有效期内可以选择{{activityInfo.sessionRestriction == 0 ? '所有的专场' : `其中${activityInfo.sessionRestriction}个专场`}}进行预约上课，{{showTimesStr}}
            </p>
            <p v-if="activityInfo.endAt != 0">
              该约课{{activityInfo.endAt}}内有效。有效期内您可以选择{{activityInfo.sessionRestriction == 0 ? '所有的专场' : `其中${activityInfo.sessionRestriction}个专场`}}进行预约上课，{{showTimesStr}}
            </p>
          </template>
        </div>
      </div>
    </cj-popup>
    <!-- 约课购买后的订单有效期提示 -->
    <cj-popup v-model="showOrderDate" round :closeable="true" title="温馨提示">
      <div class="c-ww480 c-fs24 c-fc-sblack c-textAlign-l">
        <div class="c-fs24 c-fc-sblack c-lh42 c-ph30 c-ml30">
          <p>1、
            <!-- 有效期类型isValid:1 长期有效 0：购买后n天有效 2：指定到截止日期有效 3：首次使用后n天内有效 -->
            <span v-if="activityInfo.endAt == 0 && activityInfo.orderValidDAys == 0">长期有效</span>
            <span v-if="activityInfo.endAt == 0 && activityInfo.orderValidDAys != 0">{{`首次签到后，${activityInfo.orderValidDAys}天内可预约`}}</span>
            <span v-if="activityInfo.endAt != 0">{{`${activityInfo.endAt}前有效`}}</span>
          </p>
          <!-- 限专场 -->
          <p v-if="activityInfo.sessionRestriction != 0">
            <span>2、</span>只能预约其中{{activityInfo.sessionRestriction}}个专场，<span>{{showTimesStr}}</span>
          </p>
          <!-- 不限专场 -->
          <p v-else-if="activityInfo.timesRestriction != 0">
            <span>2、</span><span>{{activityInfo.timesRestriction == 2 ? '每个专场': ''}}可预约次数：{{activityInfo.times}}次。</span>
          </p>
          <p class="c-fs22 c-fc-smblue c-lh c-pt20 c-pb40">请积极参与预约上课！</p>
        </div>
        <div class="c-fs26 c-fc-smblue c-hh84 c-flex-row c-aligni-center c-justify-center c-bd-t1-eee" @click="closeOrderDate">我知道了</div>
      </div>
    </cj-popup>
    <!-- 约课的预约记录 -->
    <cj-popup v-model="showHistoryDialog" round :closeable="true">
      <section class="c-pv20 c-fs20 c-textAlign-l c-ph40 c-contexty-auto c-maxh760 c-ww600">
        <div class="c-pv20" v-for="(item,index) in historyList" :key="index">
          <p class="c-flex-row c-aligni-center">
            <span class="c-ww48">{{index * 1 + 1}}.</span>
            <span class="c-text-ellipsis1">【{{item.sessionName}}】</span>
          </p>
          <p class="c-pt10 c-fc-sblack c-text-ellipsis1" v-if="item.reservationMode == 2">时间：{{item.startAt}}至{{item.endAt}}</p>
          <p class="c-pt10 c-fc-sblack c-text-ellipsis1" v-if="item.reservationMode == 1">预约时间：{{item.enrollTime}}</p>
          <p class="c-pt10 c-fc-sblack c-text-ellipsis1">地点：{{item.place}}</p>
        </div>
        <div @click="goToMyReservationList" class="c-fs20 theme-fc c-pv20 c-textAlign-c">查看详情</div>
      </section>
    </cj-popup>
    <coupon-list-com
      @closeModal="closeModal"
      @getCouponList="getCouponList"
      :couponIsPage="couponIsPage"
      :couponLoading="couponLoading"
      :couponList="couponList"
      :showCoupon="showCoupon"
      :prodType="from == 'reservation' ? 53 : 7"
      :sales="from == 'reservation' ? activityInfo.sales : ''"
      :fromType="from"
      :prodId="Number(mainId)"
      :dataInfo="activityInfo"
      :collage="dataInfo.collage"
    ></coupon-list-com>
    <!-- 推荐有礼 -->
    <recommend-present ref="recommendPresent"></recommend-present>
    <!-- 入群引导 -->
    <group-guidance ref="guidance" position="bottom" :isType="true" :groupObject="guideInfo"></group-guidance>
    <!-- 关注二维码 -->
    <offical-account
      v-if="dataInfo && dataInfo.bargain"
      :showAccountQcode="showAccountQcode"
      :desc="officalDesc"
      :imgSrc="$addXossFilter(mpQrcode)"
      @hideDialog="hideDialog"
    ></offical-account>
    <open-modal :openModal="openModalPoster" @closeModal="closeModalPoster">
      <div class="c-bg-white c-br-tl20 c-br-tr20 c-pr24 c-pl24 c-maxh760 ">
        <div class="c-hh80 c-lh80 c-textAlign-c c-fs24 c-bd-b1">请选择要分享的活动</div>
        <div class="c-hh80 c-lh80 c-textAlign-c c-fs24 theme-fc" @click="handleClickPoster(item)" :class="index == marketList.length - 1 ? '':'c-bd-b1'" v-for="(item, index) in marketList" :key="index">{{item.mtkType == 2 ? '拼团':item.mtkType == 12 ? '砍价购':item.mtkType == 1 ? '限时购':''}}-{{item.name}}</div>
      </div>
    </open-modal>
    <recommend-award v-if="dataInfo.recommend && dataInfo.recommend.isExist" :action="dataInfo.recommend && dataInfo.recommend.action"></recommend-award>
    <promote-income v-if="from == 'activity' && (showMarketingCard || (activityInfo.isInvitionCard == 1 && dataInfo.bargain == null && collage == null && !activitySales && retEnroll != 2 && marketingNum == 1 && (dataInfo.recommend && dataInfo.recommend.isExist == 0)))"
      :showInvitionCard="showInvitionCard"
      :showMarketingCard="showMarketingCard"
      :prodId="mainId"
      :prodType="cfrom.activity"
      @goInvite="spreadInvite"
      @goMarketingPoster="invitePoster"
    ></promote-income>
    <promote-income v-if="from == 'reservation' && activityInfo.price > 0 && !activityInfo.isFriendHelper && !activityInfo.sales" :showInvitionCard="true" :prodId="mainId" :prodType="cfrom.reservation" @goInvite="goToInviteReservation"></promote-income>
    <SelectActivityBill ref="selectActivityBill" :isSummitActivity="!!(activityInfo.isSummitActivity)" />
    <cj-confirm :isShow="isShowVerifyTip" :option="{title:'', message: '', titleCenter: true, showMasker: true, clickCloseModal: false, showCancelButton: false, cancelButtonText: '',confirmButtonText: '去认证'}" @onConfirm="goToAuthentication">
      <div class="c-p c-fc-xblack">
        <div class="c-textAlign-c c-fs28 c-fw600">实名认证</div>
        <div class="c-mt20 c-ph40 c-fs24">请继续点击下方按钮实名认证，认证成功后方可通过人脸识别进入会场</div>
        <span @click="isShowVerifyTip = false" class="iconfont c-fs24 c-fc-sgray c-pa c-p-tm20 c-p-r20">&#xe773;</span>
      </div>
    </cj-confirm>
  </div>
</template>


<script>
import MySmallTabbar from "@/components/templates/common/MySmallTabbar.vue";
import ActiveAndColumn from "@/components/templates/activeAndColumn.vue";
import OpenModal from "@/components/templates/common/openModal.vue";
import { utilJs, wxUtilJs } from "@/utils/common.js";
import loadingStatusTem from "@/components/templates/common/loadingStatusTem.vue";
import shareMasker from "@/components/templates/common/shareMasker.vue";
import SectionPeriods from '@/components/templates/sectionPeriods.vue'
import couponListCom from "@/components/templates/couponListCom.vue";
import recommendPresent from '@/components/templates/recommendPresent';
import FlashSalesTimeNew from "@/components/templates/flashSalesTimeNew.vue";
import CollagePersonsList from "@/components/templates/collage/collagePersonsList.vue";
import groupGuidance from '@/components/templates/common/groupGuidance.vue';
import PriceBar from '@/components/templates/common/priceBar.vue';
import RecommendAward from "@/components/member/recommend/recommendAward.vue";
import bargainRules from '@/components/templates/bargain/bargainRules';
import activityBargain from '@/components/templates/bargain/activityBargain';
import officalAccount from '@/components/templates/common/officalAccount';
import activityMarket from '@/components/activity/activityMarket';
import courseDescription from '@/components/templates/courseDescription';
import PromoteIncome from '@/components/templates/common/promoteIncome.vue';
import SelectActivityBill from '@/components/templates/activity/selectActivityBill.vue';
import { getBindPhoneSetting } from "@/utils/checkUnBindPhone.js";
import DiscountInfo from "@/components/templates/common/discountInfo.vue";
// import VipEntry from "@/components/templates/common/vipEntry.vue";
import InviteGroup from "@/components/templates/common/inviteGroup.vue";
import formEntry from "@/components/homePage/form/formEntry.vue"
import giftModal from '@/components/templates/giftModal';
import CjConfirm from "@/plugin/cjConfirm/cjConfirm.vue";
import commentCom from "@/components/templates/common/commentCom.vue";
const THEME_RGB_MAP = global.THEME_RGB_MAP;
let weekMap = {
  7: "周日",
  1: "周一",
  2: "周二",
  3: "周三",
  4: "周四",
  5: "周五",
  6: "周六"
};
// 特定活动（5000人峰会），报名列表最多展示1000条报名记录
const SUMMIT_ACTIVITY_PEOPLE_MAX = 1000
export default {
  name: "ActivityDetail",
  components: {
    formEntry,
    DiscountInfo,
    // VipEntry,
    InviteGroup,
    MySmallTabbar,
    ActiveAndColumn,
    shareMasker,
    OpenModal,
    SectionPeriods,
    couponListCom,
    recommendPresent,
    FlashSalesTimeNew,
    CollagePersonsList,
    groupGuidance,
    loadingStatusTem,
    PriceBar,
    bargainRules,
    officalAccount,
    activityBargain,
    activityMarket,
    courseDescription,
    RecommendAward,
    PromoteIncome,
    SelectActivityBill,
    giftModal,
    CjConfirm,
    commentCom
  },
  props: [],
  filters: {
    formatStringTime(value) {
      if (!!value) {
        return value.substr(0, 16);
      } else {
        return value;
      }
    }
  },
  computed: {
    isShowUserGroupNotAllow() {
      if (!this.activityInfo) {
        return false;
      }
      //允许报名
      const isCanBuy = this.activityInfo.status == 1 && this.canBuy;
      //开启分组 && 不在指定分组内
      const isUserGroup = this.activityInfo.isUserGroup == 1 && !this.activityInfo.isInUserGroup;
      // 开启组织架构 && 不在指定组织架构内
      const isDepartments = this.activityInfo.isDepartments == 1 && this.activityInfo.isUserInDepartment != 1;
      // 如果允许报名，但是指定了分组或者组织架构，又不在名单里，则显示指定用户不可报名
      return isCanBuy && (isUserGroup || isDepartments);
    },
    // 判断是否是推荐有礼;
    isRecommend() {
      return this.recType == 3 && this.dataInfo.recommend && this.dataInfo.recommend.isExist
    },
    //活动排行榜是否显示报名
    isRankCanApply() {
      //当前活动正在进行中 && 当前可以购买 && 是否指定用户参与 && 不是指定的用户指定用户  --无法购买
      let res = this.activityInfo.status == 1 && this.canBuy && this.activityInfo.isUserGroup == 1 && !this.activityInfo.isInUserGroup;
      if (res) {
      return false;
      }
      // 上面旧的活动排行榜条件抄下来的，不知道具体含义，先这样处理
      let res1 = !(this.collage && this.collage.status == 2);
      let res2 = this.collage && this.collage.status == 2 && this.collage.userType == -1;
      //当前活动正在进行中 && 当前剩余票>0 && 不是等待审核状态 && 没有权限
      res = this.activityInfo.status == 1 && this.activityInfo.remianingTickNumber && !this.isShowWaitCheck && !this.hasPermission && (res1 || res2);
      return res;
    },
    originPrice() { // 与vip/svip价格做对比的价格
      // 当最低价格为0时，有免费券，不需要显示会员价格；当vip/svip折扣100时，说明没打折直接按vip/svip价格
      let lowPrice = this.activityInfo.price && this.activityInfo.price.includes('~') > -1 ? Number(this.activityInfo.price.split('~')[0]) : this.activityInfo.price;
      return Number(lowPrice == 0 ? 0 : this.activityInfo.svipDiscount == 100 ? this.activityInfo.vipDiscount == 100 ? Number(this.activityInfo.vipDiscountPrice) : Number(this.activityInfo.svipDiscountPrice) : this.activityInfo.vipPrice)
    },
    //单卖&&没有权限&&价格大于0&&（加入形式&&不是好友助力）&&（优惠券||vip svip折扣信息||积分抵扣）&&（是否参与营销）
    showDiscount() {
      let showdiscount = this.activityInfo.isSaleOnly != 0 && ((this.marketingNum == 1 && this.hasPermission == false) || this.marketingNum != 1) && !this.activityInfo.isFriendHelper
      return showdiscount
    },
    isShowGetCoupon() {
      //存在优惠券 && 存在价格 && (（约课 && 非好友助力 && 非限时购 && 价格不为0）|| (活动 && 非拼团 && 显示价格 && 价格不等0 && isRefund ！= 1)
      let isShow = this.activityInfo && this.activityInfo.price &&
      ((this.from == 'reservation' && !this.activityInfo.isFriendHelper && Number(this.activityInfo.price) != 0) ||
      (this.from == 'activity' && this.dataInfo && this.activityInfo.price != '0.00~0.00' && this.activityInfo.isRefund != 1));
      return isShow;
    },
    showTimesStr() {
      if (this.activityInfo.timesRestriction == 0) {
        return '预约次数不限。'
      } else if (this.activityInfo.timesRestriction == 1) {
        return `可预约${this.activityInfo.times}次。`
      } else if (this.activityInfo.timesRestriction == 2) {
        return `每个专场可预约${this.activityInfo.times}次。`
      }
      return '';
    },
    showReservationExpireTips() {
      if (this.from == 'reservation' &&
        this.companyAuth.enableDeclareModule == 0 &&
        (this.activityInfo.isEnroll == 2 || this.activityInfo.isEnroll == 1)) {
        return true
      } else {
        return false
      }
    },
    isShowExpireOrNoTimes() {
      if (this.from == 'reservation' &&
        this.companyAuth.enableDeclareModule == 0 &&
        (this.activityInfo.isEnroll < 0 ||
          (this.activityInfo.isEnroll != 1 && this.activityInfo.isEnroll != 3 && this.activityInfo.residueDegree == 0))) {
        return true
      } else {
        return false
      }
    },
    isReservationCourse() {
      //复训模式已购买未预约; 连续预约模式,考虑次数前提 已有进行中预约和已购买未预约
      // isEnroll 1：已有进行中的预约
      if (this.activityInfo.reservationMode == 2) {
        if ((this.activityInfo.isEnroll == 2 && this.activityInfo.enrollMode == 1) || (this.activityInfo.enrollMode == 2 && this.activityInfo.residueDegree != 0 && (this.activityInfo.isEnroll == 1 || this.activityInfo.isEnroll == 2))) {
          return true
        } else {
          return false
        }
      } else {
        if ((this.activityInfo.isEnroll == 2 || this.activityInfo.isEnroll == 1) && this.activityInfo.residueDegree != 0) {
          return true
        } else {
          return false
        }
      }
    },
    showApplyList() {
      if (this.applyList.length == 0) {
        return false;
      }
      if (this.from == 'activity' && (this.activityInfo.enableHeadImgUrl == 1 || ( this.hasPermission && this.activityInfo.enableHeadImgUrl == 2))) {
        return true;
      }
      if (this.from == 'reservation' && this.activityInfo.isShowOrder == 1) {
        return true;
      }
      if (this.from == 'sectionInfo' && this.activityInfo.isShowEnroll == 1) {
        return true;
      }
      return false;
    },
    tabList() {
      let arr = [];
      arr.push({
        title: '详情',
        index: 0
      })
      if (this.commentInfo.isShowCommnet) {
        arr.push({
          title: '评论',
          index: 2,
          smallNum: this.commentCount || 0
        })
      }
      const hasRelation = this.relationData && (this.relationData.columns.length > 0 || this.relationData.courses.length > 0 ||
        this.relationData.datums.length > 0 || this.relationData.exams.length > 0 ||
        this.relationData.goods.length > 0 || this.relationData.mutuals.length > 0 ||
        this.relationData.socials.length > 0 || this.relationData.speechs.length > 0)
      if (hasRelation) {
        arr.push({
          title: '推荐',
          index: 1
        })
      }
      return arr;
    },
    // 是否可购买
    canBuy() {
      //  (（无待审核票&&无成功票）|| 可重复下单) && 报名人数小于总票数
      let canBuy = ((!this.isShowWaitCheck && this.activityInfo.chk != 1) || this.activityInfo.isRepeatOrder == 1) && this.activityInfo.remianingTickNumber > 0;
      return canBuy;
    },
    showSalesTime() {
      let reservationShow = this.from == 'reservation';
      let activityShow = this.from == 'activity';
      let showSalesTime = this.activityInfo && (reservationShow || activityShow) && this.marketingNum == 1 && ((this.dataInfo.bargain && ((this.dataInfo.bargain.status == 1 && this.dataInfo.bargain.isPreheat == 1) || this.dataInfo.bargain.status == 2)) || this.activityInfo.isFriendHelper);
      return showSalesTime;
    },
    showMarketingBar() {
      let reservationShow = this.from == 'reservation';
      let activityShow = this.from == 'activity';
      return this.activityInfo && (reservationShow || activityShow) && this.marketingNum == 1 && (this.activityInfo.sales || (this.dataInfo.bargain && ((this.dataInfo.bargain.status == 1 && this.dataInfo.bargain.isPreheat == 1) || this.dataInfo.bargain.status == 2)) || (this.activityInfo.status == 1 && this.activityInfo.remianingTickNumber > 0 && this.activitySales != null) || (this.activityInfo.status == 1 && this.activityInfo.remianingTickNumber > 0 && (this.collage != null && this.collage.status == 2)) || this.activityInfo.isFriendHelper);
    },
    // 存在营销活动
    hasMarketingActivity() {
      return (this.from == 'activity' && this.marketingNum > 1) || this.showMarketingBar;
    },
    giftTipText() {
      // 礼包领取设置: giftDeliveryMethod 1报名成功后即可领取  2首次签到后可领取
      return `<p>赠品需${this.activityInfo && this.activityInfo.giftDeliveryMethod == 2 ? '首次签到' : '要等报名审核通过'}后，前往我的活动报名记录页领取</p><p class="c-fc-red">注：礼包领取后，该票券就不能继续赠送给他人了</p>`;
    },
    showInvitionCard() {
      return this.activityInfo.isInvitionCard == 1 && !this.dataInfo.bargain && !this.collage && !this.activitySales && this.retEnroll != 2 && this.marketingNum == 1 && (this.dataInfo.recommend && this.dataInfo.recommend.isExist == 0)
    },
    // 判断是否有顶部导航
    unenableTopNav() {
      const companyAuth = localStorage.getItem("companyAuth") ? JSON.parse(localStorage.getItem("companyAuth")) : {};
      return companyAuth && companyAuth.companyTopNav && companyAuth.companyTopNav.style && companyAuth.companyTopNav.style == 5
    },
    showMarketingCard() {
      return !this.$isWxApp() && (this.collage != null || this.activitySales || this.dataInfo.bargain != null || this.marketingNum > 1)
    },
    hasCommentPerm() {
      let reservationPermission = this.isReservationCourse || (this.activityInfo.isEnroll == 1 && this.activityInfo.enrollMode == 1);
      return this.from == 'activity' ? this.hasPermission : reservationPermission;
    }
  },
  data() {
    return {
      commentInfo:{
        isShowCommnet:false,
        count:0,
        comment: null,
      },
      showApply:false,
      showGifts:false,
      showDate: true,
      showRefreshmentDesc: false,
      showOrderDate: false,
      showShareMoneyTip: true,
      commission: 0,
      theme: localStorage.getItem("colorName")
        ? localStorage.getItem("colorName")
        : "mb5_default",
      hasPermission: false, // 是否有权限
      isShowWaitCheck: false, // 待审核按钮
      isShowShare: false,
      activityInfo: {},
      applyList: [], // 已报名的用户
      total:0, //用户数
      ticketId: null, // 如果已报名，报名的票id
      activityStatus: "已结束", // 活动状态，主要记录后台是否手动结束活动
      relationData: "",
      cfrom: global.ckFrom,
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      showExpire: false, // 时间是否到期
      collage: null,
      activitySales: null,
      showInvLink: false, //显示邀请榜
      invLinkList: [], //邀请榜
      myInvInfo: {}, //我的邀请榜信息
      from: 'activity', // 来源： activity活动 reservation约课 'sectionInfo'场次
      mainId: null, // 活动就是活动id, 约课就主题Id
      periodsList: [],
      showHistoryDialog: false,
      historyList: [], //预约记录
      showMoreHistory: false,
      rpId: '',
      reId: '',
      rsId: '', // 场次id
      enrollInfo: {}, // 若是未付款订单 报名表单信息
      typeBar: 0,
      faStatus: 1,
      showCoupon: false,
      couponList: [],
      couponIsPage: false,
      couponPage: 1,
      couponLoading: false,
      recType: 0, // 推荐类型 1 访问 2 绑定 3 支付
      recRelateId: '',
      isSales: false,
      retEnroll: "",
      dataInfo: "",
      guideInfo: "", //入群引导信息
      // showGuidePop: false, //显示入群提示
      fromType: '', //是否从付款页面过来
      isShowTip: false, // 是否显示可以免费买票
      isSalesBegin: false, // 是否限时购正在进行
      vipType: localStorage.getItem("vipType" + localStorage.getItem("userId")),
      vipFitstItem: localStorage.getItem("vipArr1") ? JSON.parse(localStorage.getItem("vipArr1")) : null,
      svipFitstItem: localStorage.getItem("svipArr1") ? JSON.parse(localStorage.getItem("svipArr1")) : null,
      cfg: JSON.parse(localStorage.getItem("cfg")),
      showAccountQcode: false,
      officalDesc: '关注我们后才可发起砍价哦',
      mpQrcode: '',
      marketingNum: 1, //默认只参加了一种营销活动
      marketList: [],
      openModalPoster: false,
      refereeId: '',
      isPayOrder: 0,
      myCalendarList: [],
      selectIndex: 0,
      selectTimeIndex: 0,
      selectTime: '',
      weeked: '',
      localDate: '', // 今天日期
      coachList: [],
      selectCoachIndex: 0,
      coachObject: null,
      selectCityIndex: 0,
      validAt: '',
      bindPhoneSetting: null,
      isExist: true,
      isShowAllSponsor: false, // 是否展示所有主办/协办方
      isShowFormlg: localStorage.getItem("showForm") == 1 ? true : false,
      isCustServiceOpen: localStorage.getItem("isCustServiceOpen") == 1 ? true : false,
      pageIndex:1,
      dataStatus:'HAS_MORE_DATA',
      summitActivityPeopleMax: SUMMIT_ACTIVITY_PEOPLE_MAX,
      isShowVerifyTip: false, // 是否展示认证提示弹窗
      commentCount: 0, // 评论数量
    };
  },
  watch: {
    $route: function (to, from) { // 监听路由 场次详情和主题详情切换的时候重新获取数据
      if (to.path == '/activity/activityDetail') {
        this.from = to.query.from ? to.query.from : 'activity';
        this.from == 'activity' ? setDocumentTitle("活动详情") : (this.from == 'reservation' ? setDocumentTitle("主题详情") : setDocumentTitle("场次详情"));// eslint-disable-line
        this.mainId = to.query.ActivityNo;
        this.rsId = to.query.rsId ? to.query.rsId : '';
        this.applyList = [];
        this.total = 0
        this.dataStatus = 'HAS_MORE_DATA'
        this.pageIndex = 1
        this.historyList = [];
        this.commentInfo = {
            isShowCommnet:false,
            count:0,
            comment: null,
        };
        this.showHistoryDialog = false;
        this.cloroRGB = THEME_RGB_MAP[this.theme];
        this.faStatus = 1;
        this.isSales = false;
        this.guideInfo = "";
        if (this.from == 'activity') {
          this.getActivityInfo();
          this.getPerson();
        } else if (this.from == 'reservation') {
          this.getReservationDetail();
          this.getBuyedPeople();
        } else {
          this.getSectionDetail();
          this.getRePeople();
        }
      }
    }
  },
  created() {
    utilJs.appShare(this);
  },
  methods: {
    addComment() {
      this.changeType(2)
      this.$nextTick(() => {
        if (this.commentInfo.isShowCommnet && this.$refs.commentCom) {
          this.$refs.commentCom.public_addComment()
        }
      })
    },
    getCommentCount(count = 0) {
      this.commentCount = count
    },
    goToAuthentication() {
      const enrollEndAt = this.activityInfo.enrollEndAt || ''
      const endTime = new Date(enrollEndAt.replace(/-/g, '/')).getTime()
      const nowTime = new Date().getTime()
      const isActivityEnd = nowTime > endTime
      if (!this.activityInfo.summitVerifyUrl || isActivityEnd) {
        return
      }
      window.location.href = this.activityInfo.summitVerifyUrl
    },
    openGifts() {
      // 有权限,跳到我的票券详情页
      if (this.activityInfo.hasPermission) {
        this.$routerGo(this, "push", {
          path: `/activity/myTicket?activityId=${this.mainId}&identCode=${this.activityInfo.identCode}&asId=${0}`
        });
        return
      }
      this.showGifts = true
    },
    // 小程序咨询客服
    goWxAppContact() {
      utilJs.miniProgramGoTo('push', "/pages/member/contact/index")
    },
    // 判断是否跳转表单
    isGoForm (commMarketData = null) {
      // 购买前后判断collectPage：1购买前2购买后3非强制
      if ((this.activityInfo.collectPage == 1 || (this.activityInfo.collectPage == 2 && this.activityInfo.hasPermission == true)) && this.activityInfo.isRelForm == true && this.activityInfo.hasFormLog == false && localStorage.getItem("showForm") == 1) {
        return true;
      } else {
        return false;
      }
    },
    // 关联表单
    goForm(commMarketData = null) {
      let pathQuery = null;
      let isGoBack = this.activityInfo.collectPage == 3 || this.activityInfo.payType == 3 || this.activityInfo.hasPermission == true || (this.showSalesTime && !this.activityInfo.sales) || this.activityInfo.isSaleOnly == 0 ? 1 : 0;
      let pId = this.isSales ? this.activityInfo.sales.pId : null;
      let ckFrom = this.isSales ? global.ckFrom.flashSalesActivity : global.ckFrom.activity;
      let bargainId = this.activityInfo.bargain ? this.activityInfo.bargain.bargainId : '';
      pathQuery = {
        cId: -1,
        extId: this.activityInfo.activityId,
        ckFrom: ckFrom,
        isFromInvite: 0,
        pId: pId,
        relType: 7,
        type: 1,
        recRelateId: this.$route.query.recRelateId,
        recType: this.$route.query.recType,
        isGoBack: isGoBack,
        bargainId: bargainId
      };
      if (this.goodsRoomId) {
        pathQuery.goodsRoomId = this.goodsRoomId;
      }
      if (this.activityInfo.collectPage == 1) { //购买前跳转关联表单，提交后直接跳转到选票页面
        // pathQuery.isGoActivityBills = 1;
        let activityBillsData = commMarketData ? commMarketData : this.goBuy(1);
        sessionStorage.setItem('activityBillsData', JSON.stringify(activityBillsData))
      }
      this.$routerGo(this, "push", { path: '/homePage/form', query: pathQuery });
    },
    // 已报名列表总数
    getEnrollTotal() {
      // isSummitActivity 特定活动(5000人峰会),已报名数需要加上虚拟报名数
      if (this.activityInfo.isSummitActivity) {
        // 虚拟报名数
        const virtualEnrollNum = Number(this.activityInfo.enableVirtualEnroll == 1 && this.activityInfo.virtualEnrollNum ? this.activityInfo.virtualEnrollNum : 0)
        const enrollTotal = Number(this.total) + virtualEnrollNum
        return enrollTotal > 5000 ? '5000+' : enrollTotal
      }
      return this.total
    },
    getEnrollNum(num, type = 1) { // type 1已报名  2限制报名总数（20241125产品黄长发，调整限制报名总数都不加上虚拟报名数）
      // 虚拟报名数
      const virtualEnrollNum = Number(this.activityInfo.enableVirtualEnroll == 1 && this.activityInfo.virtualEnrollNum ? this.activityInfo.virtualEnrollNum : 0)
      // 普通活动报名数统计，报名人数 = 实际已报名数 + 虚拟报名数
      const commentActivity = Number(num) + (virtualEnrollNum)
      // isSummitActivity 是否是特定活动(5000人峰会) 报名人数 = 实际已报名数 + 虚拟报名数；大于5000显示5000+;
      if (type == 1 && this.activityInfo.isSummitActivity) {
        return commentActivity > 5000 ? '5000+' : commentActivity
      }
      return type == 2 ? Number(num) : commentActivity
    },
    changeShowAllSponsor() {
      this.isShowAllSponsor = !this.isShowAllSponsor;
    },
    finishMarket() {
      this.isPayOrder = 0;
    },
    closeModalPoster() {
      this.openModalPoster = false;
    },
    finshTimeMarket() {
      this.getMarketingList();
    },
    // 获取多个票据参与营销活动
    getMarketingList() {
      let timeStr = (new Date()).getTime();
      utilJs.getMethod(`${global.apiurl}activities/getMarketingList?activityId=${this.mainId}&${timeStr}=1`, res => {
        this.marketList = res;
      })
    },
    handleClickMarket() {
     let offsetTop = document.getElementById('activityMarket') && document.getElementById('activityMarket').offsetTop;
      this.$nextTick(() => {
        if (offsetTop) {
          document.documentElement.scrollTop = offsetTop;
          document.body.scrollTop = offsetTop;
        }
      })
    },
    handleClickBargainActivity(item, mtkType) {
      if (mtkType == 12) {
        let q = {
          bargainId: item.bargainId,
          number: item.number,
          ckFrom: global.ckFrom.activity,
          attendId: item.attendId,
        }
        if (this.$route.query.refereeId) {
          q.refereeId = this.$route.query.refereeId;
        }
        this.$routerGo(this, "push", {
          path: "/homePage/bargain/bargainDetail",
          query: q
        });
        return
      }
      if (mtkType == 2) {
        let pathQuery = {
          groupId: item.groupId,
          collageId: item.collageId,
          isRepeatOrder: this.activityInfo.isRepeatOrder
        };
        if (this.$route.query.refereeId) {
          pathQuery.refereeId = this.$route.query.refereeId;
        }
        if (this.goodsRoomId) {
          pathQuery.goodsRoomId = this.goodsRoomId;
        }
        this.$routerGo(this, "push", {
          path: "/homePage/collage/collageDetail",
          query: pathQuery
        });
        return
      }
    },
    finshTime() {
      this.getActivityInfo();
    },
    // 砍价列表查看更多
    handleClickMyBargain() {
      this.$routerGo(this, "push", {
        path: "/homePage/bargain/myBargain"
      });
    },
    // 判断是否关注公众号
    checkUserIsFollowedMp(bargainId) {
      return new Promise(function (resolve, reject) {
        utilJs.getMethod(`${global.apiurl}bargains/getMpData?bargainId=${bargainId}`,
          res => {
            resolve(res);
          },
          failRes => {
            reject(failRes)
          }
        )
      })
    },
    commMarketGoBuy(item) {
      // let goPathQuery = {
      //   activityId: this.mainId,
      //   groupId: -1,
      //   collageId: item.collage ? item.collage.collageId : -1,
      //   recType: this.recType,
      //   recRelateId: this.recRelateId,
      //   isRepeatOrder: this.activityInfo.isRepeatOrder,
      //   prodId: item.collage ? item.collage.prodId : item.bargain ? item.bargain.prodId : item.sales ? item.sales.prodId : '',
      //   mtkType: item.mtkType,
      // };
      // if (this.$route.query.refereeId) {
      //   goPathQuery.refereeId = this.$route.query.refereeId;
      // }
      // if (this.goodsRoomId) {
      //   goPathQuery.goodsRoomId = this.goodsRoomId;
      // }
      let formQuery = null;
      // 有关联表单的，选完票去填表单
      if (this.isGoForm()) {
        let ckFrom = this.isSales ? global.ckFrom.flashSalesActivity : global.ckFrom.activity;
        formQuery = {
          cId: -1,
          extId: this.activityInfo.activityId,
          ckFrom: ckFrom,
          relType: 7,
          type: 1,
        }
      };
      this.$refs.selectActivityBill.public_openSelectBills({
        formQuery:formQuery,
        goodsRoomId:this.goodsRoomId,
        refereeId: this.$route.query.refereeId,
        activityId: this.mainId,
        groupId: -1,
        collageId: item.collage ? item.collage.collageId : -1,
        recType: this.recType,
        recRelateId: this.recRelateId,
        isRepeatOrder: this.activityInfo.isRepeatOrder,
        prodId: item.collage ? item.collage.prodId : item.bargain ? item.bargain.prodId : item.sales ? item.sales.prodId : '',
        mtkType: item.mtkType,
      })
    },
    goCollageDetailMakret: function (groupId, collageId, item) {
      if (item.collage.userType != -1 && this.activityInfo.isRepeatOrder != 1 && item.collage.groupId != groupId) {
        this.$showCjToast({
          text: "您已在拼团中，不需要再去拼单啦！",
          type: "warn"
        });
      } else {
        let pathQuery = {
          groupId: groupId,
          collageId: collageId,
        };
        if (this.$route.query.refereeId) {
          pathQuery.refereeId = this.$route.query.refereeId;
        }
        if (this.goodsRoomId) {
          pathQuery.goodsRoomId = this.goodsRoomId;
        }
        this.$routerGo(this, "push", {
          path: "/homePage/collage/collageDetail",
          query: pathQuery
        });
      }
    },
    handleClickCommonMarket(item) {
      // 砍价发起
      if (item.mtkType == 12) {
        if (item.bargain.status == 1) {
          this.$showCjToast({
            text: '活动未开始，暂不能砍价！',
            type: 'warn'
          });
          return;
        }
        if (this.bindPhoneSetting && this.bindPhoneSetting.buyBind) {
          let goPathQuery = {
            recType: this.recType,
            recRelateId: this.recRelateId,
            activityId: this.mainId,
            ckFrom: this.cfrom.activity,
          }
          if (this.goodsRoomId) {
            goPathQuery.goodsRoomId = this.goodsRoomId;
          }
          if (utilJs.goBindMobile(goPathQuery)) return;
        }
        if (item.bargain.userType == -1 || this.activityInfo.isRepeatOrder == 1) {
          // 未砍价
          this.commMarketGoBuy(item);
          return;
        }
        if (item.bargain.userType == 1 && this.activityInfo.isRepeatOrder == 0) {
          let pathQuery = {
            bargainId: item.bargain.bargainId,
            number: item.bargain.number,
            ckFrom: global.ckFrom.activity,
          }
          if (this.$route.query.refereeId) {
            pathQuery.refereeId = this.$route.query.refereeId;
          }
          this.$routerGo(this, "push", {
            path: "/homePage/bargain/bargainDetail",
            query: pathQuery
          });
          return;
        }
        return
      }
      // 限时购
      if (item.mtkType == 1) {
        if (this.isActivityBuy()) return;
        this.commMarketGoBuy(item);
        return
      }
      // 拼团
      if (item.mtkType == 2) {
        if (this.activityInfo.status == 1 && this.canBuy && item.collage.status == 2 && (item.collage.userType == -1 || this.activityInfo.isRepeatOrder == 1)) {
          if (this.isActivityBuy()) return;
          this.commMarketGoBuy(item);
          return
        }
        if (item.collage.status == 2 && item.collage.userType != -1 && this.activityInfo.isRepeatOrder == 0) {
          this.goCollageDetailMakret(item.collage.groupId, item.collage.collageId, item)
        }
      }
    },
    handleClickBargainDetail(bargainId) {
      if (this.dataInfo.bargain.status == 1) {
        this.$showCjToast({
          text: '活动未开始，暂不能砍价！',
          type: 'warn'
        });
        return;
      }
      // 如果开启了不可重复下单，&&  当前已经发起了其他票据得砍价
      if (this.activityInfo.isRepeatOrder == 0 && this.dataInfo.bargain.attendList.length > 0 && this.dataInfo.bargain.userType != 1) {
        this.$showCjToast({
          text: '您当前有砍价活动正在进行中，由于该活动不可重复下单，现无法再次发起!',
          type: 'warn'
        });
        return;
      }
      this.checkUserIsFollowedMp(bargainId).then(res => {
        if (res.threshold == 2 && res.isFollowedMp == 0) {
          this.mpQrcode = res.mpQrcode;
          this.showAccountQcode = true;
          return;
        }
        if (this.bindPhoneSetting && this.bindPhoneSetting.buyBind) {
          let goPathQuery = {
            recType: this.recType,
            recRelateId: this.recRelateId,
            activityId: this.mainId,
            ckFrom: this.cfrom.activity,
          }
          if (this.goodsRoomId) {
            goPathQuery.goodsRoomId = this.goodsRoomId;
          }
          if (utilJs.goBindMobile(goPathQuery)) return;
        }
        if (this.dataInfo.bargain.userType == -1 || this.activityInfo.isRepeatOrder == 1) {
          // 未砍价
          this.goBuy();
          return;
        }
        if (this.dataInfo.bargain.userType == 1 && this.activityInfo.isRepeatOrder == 0) {
          let pathQuery = {
            bargainId: bargainId,
            number: this.dataInfo.bargain.number,
            ckFrom: global.ckFrom.activity,
          }
          if (this.$route.query.refereeId) {
            pathQuery.refereeId = this.$route.query.refereeId;
          }
          this.$routerGo(this, "push", {
            path: "/homePage/bargain/bargainDetail",
            query: pathQuery
          });
          return;
        }
      })
    },
    hideDialog() {
      this.showAccountQcode = false;
    },
    handleShowGuidePop() {
      // 显示入群引导
      this.$refs.guidance.isShowPop();
    },
    //作为分享页被推荐人进入 推荐有礼相关更改
    isRecommendPage() {
      let bindPhone = this.$route.query.bindPhone; //完成推荐绑定手机号
      let data = { relateId: this.recRelateId };
      if (this.recRelateId) {
        if (this.recType == 1) {
          this.$nextTick(() => {
            this.$refs.recommendPresent.completetRecommendTask(data);
          })
        } else if (this.recType == 2) {
          if (bindPhone) {
            data.mobile = localStorage.getItem("uMobile");
            this.$refs.recommendPresent.completetRecommendTask(data);
          } else if (!localStorage.getItem("uMobile")) {
            utilJs.goBindMobile({
                recRelateId: this.recRelateId,
                recType: this.recType,
                activityId: this.mainId,
                ckFrom: this.cfrom.activity,
              })
          } else {
            this.$cjConfirm({
              title: '领取失败',
              message: '您已绑定过手机号，不在推荐范围，无法领取奖励',
              showCancelButton: false,
            })
          }
        }
      }
    },
    clickDesc(e) {
      if (!this.cfg.isCopyPicture) {
        return;
      }
      if (e.target.tagName == 'IMG' && e.target.src) {
        wxUtilJs.previewImage({
          current: e.target.src, // 当前显示图片的http链接
          urls: [e.target.src] // 需要预览的图片http链接列表
        });
      }
    },
    closeModal() {
      this.showCoupon = false;
    },
    //获取可以领取的优惠券
    getCouponList: function () {
      if (!this.couponLoading) {
        this.couponLoading = true;
        let $this = this;
        let redeemType = this.from == 'activity' ? '99' : '96';
        utilJs.getMethod(global.apiurl + 'redeemCodes/getCouponsByRedeemType?courseId=' + this.mainId + '&redeemType=' + redeemType + '&limit=10&page=' + this.couponPage, function (res) {
          $this.couponLoading = false;
          $this.couponList = res.data ? $this.couponList.concat(res.data) : [];
          $this.couponPage = res.next_page_url ? ($this.couponPage + 1) : $this.couponPage;
          $this.couponIsPage = res.next_page_url ? true : false;
        },
          failRes => {
            $this.couponLoading = false;
          }
        );
      }
    },
    goToMyReservationList() {
      this.$routerGo(this, "push", { path: `/member/myReservation/myReservationList?rtId=${this.mainId}` });
    },
    // 获取引导入群信息
    getGuideInfo() {
      //type 1:详情页；2:报名成功
      utilJs.getMethod(`${global.apiurl}activities/getGuideInfo?activityId=${this.mainId}&type=1`, (res) => {
        this.guideInfo = res;
        if (this.$refs.guidance && this.guideInfo && this.guideInfo.isOpenGuide == 1 && this.guideInfo.guideType.includes(3)) {
          utilJs.getLeadSocialLog(this.cfrom.activity, this.mainId).then(dataRes => {
            if (!dataRes || dataRes == '') {
              this.$refs.guidance.isShowPop();
              utilJs.saveLeadSocialLog(this.cfrom.activity, this.mainId)
            }
          })
        }
      });
    },
    // 获取预约记录
    getMyReservationList() {
      if (this.companyAuth.enableDeclareModule == 1) {
        return;
      }
      utilJs.getMethod(global.apiurl + 'reservations/getEnrollByUser?page=1&limit=5&listType=2&rtId=' + this.mainId, (res) => {
        this.historyList = res.data.data;
        this.showMoreHistory = res.data.total * 1 > 10;
      });
    },
    handleClickPoster(item) {
      let ckFrom = global.ckFrom.activity;
      let type = item.mtkType == 2 ? 3 : item.mtkType == 1 ? 2 : item.mtkType == 12 ? 5 : 4;
      let cId = item.mtkType == 2 ? item.collage.collageId : item.mtkType == 1 ? item.sales.pId : item.mtkType == 12 ? item.bargain.bargainId : '';
      let proId = this.mainId;
      this.$routerGo(this, "push", { path: '/homePage/spread/spreadPoster', query: { cId: cId, type: type, ckFrom: ckFrom, proId: proId } });
    },
    //活动海报
    invitePoster: function () {
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      if (this.marketingNum > 1) {
        this.openModalPoster = true;
      } else {
        let ckFrom = this.from == 'reservation' ? global.ckFrom.reservation : global.ckFrom.activity;//this.ckFrom;
        let type = this.collage ? 3 : (this.activityInfo.sales || this.activitySales) ? 2 : this.dataInfo.bargain ? 5 : 4;
        let cId = this.dataInfo.bargain ? this.dataInfo.bargain.bargainId : this.activityInfo.isFriendHelper ? this.activityInfo.faId : this.collage ? this.collage.collageId : (this.from == 'reservation' ? this.activityInfo.sales.pId : this.activitySales.pId);
        let proId = this.mainId;
        let q = { cId: cId, type: type, ckFrom: ckFrom, proId: proId };
        if (this.from == "reservation" && localStorage.getItem("shareholderId")) {
          q.shareholderId = localStorage.getItem("shareholderId");
        }
        this.$routerGo(this, "push", { path: '/homePage/spread/spreadPoster', query: q });
      }
    },
    //助力详情
    goHelpDetail: function () {
      if (this.bindPhoneSetting && this.bindPhoneSetting.helpBind && utilJs.goBindMobile()) {
        return;
      }
      if (this.faStatus == 1) {
        this.$showCjToast({
          text: '活动未开始，暂不能助力领取！',
          type: 'warn'
        });
      } else {
        this.$routerGo(this, "push", {
          path: "/homePage/task/task",
          query: { 'faId': this.activityInfo.faId, 'refereeId': localStorage.getItem("userId") }
        });
      }
    },
    // // 限时购倒计时
    falshSalesTime(status) {
      if (this.activityInfo.sales) {
        this.activityInfo.sales.sales.status = status
      } else if (this.activitySales) {
        this.activitySales.sales.status = status
      } else if (this.activityInfo.collage) {
        this.activityInfo.collage.status = status
      } else if (this.activityInfo.isFriendHelper) {
        this.faStatus = status;
      } else if (this.dataInfo.bargain) {
        this.dataInfo.bargain.status = status;
      }
    },
    // // 限时购倒计时结束
    finishFlashSales(status) {
      if (this.activityInfo.sales) {
        this.activityInfo.sales.sales.status = status
      } else if (this.activitySales) {
        this.activitySales.sales.status = status
      } else if (this.activityInfo.collage) {
        this.activityInfo.collage.status = status
      } else if (this.activityInfo.isFriendHelper) {
        this.faStatus = status;
      } else if (this.dataInfo.bargain) {
        this.getActivityInfo();
      }
      if (status == 2) {
        this.isSales = true;
      } else {
        this.isSales = false;
      }
      if (status == -1) {
        this.activityInfo.sales = null;
        this.activitySales = null;
      }
    },
    //友情灌溉倒计时
    friendTimeFn: function () {
      let stime = this.activityInfo ? utilJs.getTimeByDate(this.activityInfo.faStartAt) : 0;
      let etime = this.activityInfo ? utilJs.getTimeByDate(this.activityInfo.faEndAt) : 0;
      let nowTime = (new Date()).getTime();
      //faStatus 1未开始,2进行中,3已结束,4已停止
      let time = '';
      if (stime > nowTime) {
        this.faStatus = 1;
        time = this.activityInfo.faStartAt;
      } else if (etime > nowTime) {
        this.faStatus = 2;
        time = this.activityInfo.faEndAt;
      }
      return time;
    },
    //友情灌溉倒计时结束修改状态
    friendFinishFn: function () {
      if (this.faStatus == 1) {
        this.faStatus = 2;
        this.friendTimeFn();
      } else {
        this.activityInfo.isFriendHelper = false;
        this.faStatus = 3;
      }
    },
    changeType(index) {
      this.typeBar = index;
    },
    timeFn: function () {
      let stime = this.collage ? utilJs.getTimeByDate(this.collage.startTime) : 0;
      let etime = this.collage ? utilJs.getTimeByDate(this.collage.endTime) : 0;
      let nowTime = (new Date()).getTime();
      //.collage.status 1未开始,2进行中,3已结束,4已停止
      let time = '';
      if (stime > nowTime) {
        this.collage.status = 1;
        time = this.collage.startTime;
      } else if (etime > nowTime) {
        this.collage.status = 2;
        time = this.collage.endTime;
      } else {
        this.collage.status = 3;
      }
      return time;
    },
    finishFn: function () {
      if (this.collage.status == 1) {
        this.collage.status = 2;
        this.timeFn();
      } else {
        this.collage.status = 3;
      }
    },
    gcd: function (cinfo) {
      this.goCollageDetail(cinfo.groupId, cinfo.collageId);
    },
    goCollageDetail: function (groupId, collageId) {
      if (this.collage.userType != -1 && this.activityInfo.isRepeatOrder != 1 && this.collage.groupId != groupId) {
        this.$showCjToast({
          text: "您已在拼团中，不需要再去拼单啦！",
          type: "warn"
        });
      } else {
        let pathQuery = {
          groupId: groupId,
          collageId: collageId,
        };
        if (this.$route.query.refereeId) {
          pathQuery.refereeId = this.$route.query.refereeId;
        }
        if (this.goodsRoomId) {
          pathQuery.goodsRoomId = this.goodsRoomId;
        }
        this.$routerGo(this, "push", {
          path: "/homePage/collage/collageDetail",
          query: pathQuery
        });
      }
    },
    getActivityInfo() { //获取活动内容
      let $this = this;
      let timeStr = (new Date()).getTime();
      utilJs.getMethod(
        global.apiurl + "activities/mget?activityId=" + this.mainId + '&isSkeleton=1&' + timeStr + '=1',
        (res) => {
          if (res.data.length <= 0) {
            $this.$showCjToast({
              text: "找不到该活动了",
              type: "warn",
              time: 3000,
            }).then(() => {
                this.$routerGo($this, "push", { path: "/activity/activityIndex" });
            });
            return;
          }
          $this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
          if (res.data[0].enrollStatus == 0) {
            res.data[0].chk == 1
              ? $this.$routerGo($this, "replace", {
                path: "/activity/errorPage?from=3&&type=400"
              })
              : $this.$routerGo($this, "replace", {
                path: "/activity/errorPage?from=2&&type=400"
              });
            return;
          }

          $this.dataInfo = res; //获取到该活动的所有信息
          $this.collage = res.collage;
          $this.activitySales = res.sales;
          $this.commission = res.commission;
          $this.retEnroll = res.retEnroll; //1：已报名  2：活动结束
          //这里的limit和balance返回的是第一张参与限时购，并且还能购买（没超过限时折扣限制数量）的票的limit和balance，
          //不是该活动所有参与限时购的票的limit和balance的总和
          if ($this.activitySales && !($this.activitySales.limit == 0 || $this.activitySales.balance > 0)) {
            $this.activitySales = null;
          }
          if (res.recommend.isExist == 0) {
            $this.isExist = false;
            $this.recRelateId = '';
            $this.recType = '';
          }
          // 新价格模式活动详情页除了规格半弹窗其他都不展示积分\会员折扣信息
          res.discountInfo.deductiblePoints = 0;
          res.discountInfo.vipDiscount = 100;
          res.discountInfo.svipDiscount = 100;
          res.discountInfo.svipDiscountPrice = 0;
          res.discountInfo.vipDiscountPrice = 0;
          res.discountInfo.vipDiscountType = 1
          $this.activityInfo =
            res.data == [] || res.data == undefined ? {} : res.data[0]
          $this.activityInfo = {...$this.activityInfo, ...res.discountInfo}
          $this.activityInfo.giftRelates = res.giftRelates || []
          $this.marketingNum = res.marketingNum;
          $this.isPayOrder = res.isPayOrder;
          if ($this.activityInfo.isCopy > -1) { //-1：使用全局变量 1：允许复制 0：禁止复制
            $this.cfg.isCopy = $this.activityInfo.isCopy;
          }
          if ($this.activityInfo.isCopyPicture > -1) { //-1：使用全局变量 1：允许复制 0：禁止复制
            $this.cfg.isCopyPicture = $this.activityInfo.isCopyPicture;
          }
          if (res.marketingNum > 1) {
            $this.getMarketingList();
          }
          /*
              status：0报名未开始；1：报名进行中；2报名截止；3活动结束
              enrollStatus 0：活动未发布；1活动发布；2活动结束
              retEnroll 1已报名 2活动已结束
              chk: 0：免费票未审核；1：报名成功；-1: 作废不允许报名;2：未付款;  -2:拼团中
          */
          $this.ticketId = res.unPayInfo.actTicketId;
          $this.activityStatus = res.data[0].enrollStatus == 2 || res.data[0].status == 3 ? "已结束" : "进行中";
          // 未付款 && 报名人数<总票数 && 活动未结束 && 非报名结束活动未结束 == 活动已报名未付款提示
          let show = res.unPayInfo.length == 0 || res.retEnroll == 2 ? false : true;
          if (show) {
            this.showGoPayTip();
          }
          if (res.unPayInfo && res.retEnroll != 2) {
            $this.enrollInfo = res.unPayInfo; // 获取未付款订单的报名信息
          }
          if (res.retEnroll == 1) {
            $this.hasPermission = res.data[0].hasPermission;
            // 已报名
            if (res.data[0].permission == 19) {
              // 免费票，待审核 审核成功
              $this.isShowWaitCheck = res.data[0].chk == 0 ? true : false; // 显示待审核
            } else {
              // 收费票
              $this.isShowWaitCheck = false;
              // 已报名，收费票，已付款
            }
          } else {
            // 未报名
            $this.hasPermission = false;
            $this.isShowWaitCheck = false;
          }
          $this.$nextTick(() => {
            $this.$refs.descriptions.imgTextPreview();
          })
          $this.wechatShare();
          $this.getRelevance();
          $this.getCommontList();
          if (res.data[0].ownPermission) {
            $this.getGuideInfo();
          }

          const enrollEndAt = $this.activityInfo.enrollEndAt || ''
          const endTime = new Date(enrollEndAt.replace(/-/g, '/')).getTime()
          const nowTime = new Date().getTime()
          const isActivityEnd = nowTime > endTime
          if ($this.activityInfo.summitVerifyUrl && !isActivityEnd) { // 是否有返回认证链接，有的话需要主动弹出认证提示 && 活动未结束
            $this.isShowVerifyTip = true
          }
        }
      );
    },
    getCommontList() {
      let prodType = this.from == 'activity' ? this.cfrom.activity : this.cfrom.reservation;
      let postUrl = `${global.apiurl}comments/getLatestOneComment?prodId=${this.mainId}&prodType=${prodType}`;
      utilJs.getMethod(postUrl, res => {
        this.commentInfo = res || {isShowCommnet: false};
        if (this.commentInfo.isShowCommnet && this.$refs.commentCom) {
          this.$refs.commentCom.public_initData()
        }
      })
    },
    onApplyScroll() {
      let domScroll = document.getElementById('scrollApplyList');
      if (domScroll && this.checkScrollBottom(domScroll) && this.dataStatus == 'HAS_MORE_DATA') {
        if (this.from == 'activity') {
          this.getPerson();
        } else if (this.from == 'reservation') {
          this.getBuyedPeople();
        } else {
          this.getRePeople();
        }
      }
    },
    //是否滚到底部
    checkScrollBottom(curDom) {
      if (curDom.scrollTop + curDom.clientHeight >= curDom.scrollHeight - 5) {
        return true;
      } else {
        return false;
      }
    },
    getPerson() {
      if (this.dataStatus == 'LOADING') {
        return;
      }
      this.dataStatus = 'LOADING';
      // 获取报名列表
      utilJs.postMethod(
        global.apiurl + "activities/mgperson",
        {
          activityId: this.mainId,
          page: this.pageIndex,
          limit: 10
        },
        res => {
          if (this.pageIndex == 1) {
            this.applyList = res.data.data;
          } else {
            this.applyList = [...this.applyList, ...res.data.data];
          }
          // isSummitActivity 特定活动(5000人峰会), 最多只展示1000条数据
          if (this.activityInfo.isSummitActivity && this.applyList.length >= SUMMIT_ACTIVITY_PEOPLE_MAX) {
            this.dataStatus = 'NO_MORE_DATA'
            this.total = res.total
            return
          }
          if (res.data.data && (res.data.data.length < 10)) {
            this.dataStatus = this.pageIndex == 1 && res.data.data.length == 0 ? 'NO_DATA' : 'NO_MORE_DATA';
          } else {
            this.dataStatus = 'HAS_MORE_DATA';
            this.pageIndex++;
          }
          this.total = res.total
        }
      );
    },
    getRelevance() { // 获取关联数据
      let $this = this;
      let id = this.mainId + '' // 数字会报错 先改成字符串
      utilJs.postMethod(
        global.apiurl + "common/relevance",
        { objId: id, ckFrom: this.from == 'activity' ? this.cfrom.activity : this.cfrom.reservation },
        function (res) {
          $this.relationData = res;
        }
      );
    },
    //分享
    wechatShare: function () {
      let title = (this.activityInfo.shareConf && this.activityInfo.shareConf.shareTitle) || this.activityInfo.name;
      if (this.marketingNum == 1) {
        if (this.activitySales || (this.activityInfo && this.activityInfo.sales)) {
          title = `【限时抢购】${title}`;
        }
        if (this.collage != null && this.collage.status == 2) {
          title = `【邀您一起拼团】${title}`;
        }
        if (this.companyAuth.enableFriendHelper == 1 && this.activityInfo.isFriendHelper == true) {
          title = `【快来帮我灌溉吧】${title}`;
        }
        if (this.dataInfo.bargain != null && ((this.dataInfo.bargain.status == 1 && this.dataInfo.bargain.isPreheat == 1) || this.dataInfo.bargain.status == 2)) {
          title = `【邀您一起砍价】${title}`;
        }
      } else {
        title = `【邀您一起参与】${title}`
      }
      let shareImg = this.activitySales && this.activitySales.shareImg
        ? this.activitySales.shareImg
        : (this.activityInfo && this.activityInfo.sales && this.activityInfo.sales.shareImg)
          ? this.activityInfo.sales.shareImg
          : ((this.activityInfo.shareConf && this.activityInfo.shareConf.sharePic) || this.activityInfo.poster);
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?ActivityNo=${this.mainId}&from=${this.from}&refereeId=${localStorage.getItem("userId")}`;
      if (this.from == "reservation" && localStorage.getItem("shareholderId")) {
        shareUrl += "&shareholderId=" + localStorage.getItem("shareholderId");
      }
      let shareDesc = (this.activityInfo.shareConf && this.activityInfo.shareConf.shareDesc) || this.activityInfo.shareDesc;
      utilJs.wechatConfig(shareUrl, title, shareImg, shareDesc, function () { }, true);
    },
    //手机端分享
    appShare: function () {
      let title = (this.activityInfo.shareConf && this.activityInfo.shareConf.shareTitle) || this.activityInfo.name;
      if (this.marketingNum == 1) {
        if (this.activitySales || (this.activityInfo && this.activityInfo.sales)) {
          title = `【限时抢购】${title}`;
        }
        if (this.collage != null && this.collage.status == 2) {
          title = `【邀您一起拼团】${title}`;
        }
        if (this.companyAuth.enableFriendHelper == 1 && this.activityInfo.isFriendHelper == true) {
          title = `【快来帮我灌溉吧】${title}`;
        }
        if (this.dataInfo.bargain != null && ((this.dataInfo.bargain.status == 1 && this.dataInfo.bargain.isPreheat == 1) || this.dataInfo.bargain.status == 2)) {
          title = `【邀您一起砍价】${title}`;
        }
      } else {
        title = `【邀您一起参与】${title}`
      }
      let shareImg = this.activitySales && this.activitySales.shareImg
        ? this.activitySales.shareImg
        : (this.activityInfo && this.activityInfo.sales && this.activityInfo.sales.shareImg)
          ? this.activityInfo.sales.shareImg
          : ((this.activityInfo.shareConf && this.activityInfo.shareConf.sharePic) || this.activityInfo.poster);
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?ActivityNo=${this.mainId}&from=${this.from}&refereeId=${localStorage.getItem("userId")}`;
      if (this.from == "reservation" && localStorage.getItem("shareholderId")) {
        shareUrl += "&shareholderId=" + localStorage.getItem("shareholderId");
      }
      let shareDesc = (this.activityInfo.shareConf && this.activityInfo.shareConf.shareDesc) || this.activityInfo.shareDesc || "点击查看详情";
      utilJs.appShareTrue(title, shareImg, shareUrl, shareDesc);
    },
    goBuy(isGetData = 0) {
      let goPathQuery = {
        activityId: this.mainId,
        groupId: -1,
        collageId: this.collage ? this.collage.collageId : -1,
        recType: this.dataInfo.recommend.isExist ? this.recType : '',
        recRelateId: this.dataInfo.recommend.isExist ? this.recRelateId : '',
        isRepeatOrder: this.activityInfo.isRepeatOrder,
        prodId: this.collage ? this.collage.prodId : this.dataInfo.bargain ? this.dataInfo.bargain.prodId : this.dataInfo.sales ? this.dataInfo.sales.prodId : '',
        mtkType: this.activityInfo.mtkType,
      };
      if (this.$route.query.refereeId) {
        goPathQuery.refereeId = this.$route.query.refereeId;
      }
      if (this.goodsRoomId) {
        goPathQuery.goodsRoomId = this.goodsRoomId;
      }
      if (isGetData == 1) { // 为了跳转关联表单后还能获取到activityBills需要的信息
        return goPathQuery
      }
      // 判断是否有关联表单，并且购买前填写
      let formQuery = null;
      if (this.isGoForm()) {
        let ckFrom = this.isSales ? global.ckFrom.flashSalesActivity : global.ckFrom.activity;
        formQuery = {
          cId: -1,
          extId: this.activityInfo.activityId,
          ckFrom: ckFrom,
          relType: 7,
          type: 1,
        }
      }
       this.$refs.selectActivityBill.public_openSelectBills({
        formQuery: formQuery,
        goodsRoomId:this.goodsRoomId,
        refereeId: this.$route.query.refereeId,
        activityId: this.mainId,
        isRepeatOrder: this.activityInfo.isRepeatOrder,
        groupId: -1,
        collageId: this.collage ? this.collage.collageId : -1,
        recType: this.dataInfo.recommend.isExist ? this.recType : '',
        prodId: this.collage ? this.collage.prodId : this.dataInfo.bargain ? this.dataInfo.bargain.prodId : this.dataInfo.sales ? this.dataInfo.sales.prodId : '',
        recRelateId: this.dataInfo.recommend.isExist ? this.recRelateId : '',
        mtkType: this.activityInfo.mtkType,
      })
    },
    isActivityBuy() {
      // 判断电偶是否到期，到期之后不可购买商品
      if (utilJs.alertShopExpire(this, utilJs.getTimeByDate(this.companyAuth.expireTime))) return true;
      if (this.bindPhoneSetting && this.bindPhoneSetting.enrollBind) {
        let goPathQuery = {
          recType: this.recType,
          recRelateId: this.recRelateId,
          activityId: this.mainId,
          ckFrom: this.cfrom.activity,
        }
        if (this.goodsRoomId) {
          goPathQuery.goodsRoomId = this.goodsRoomId;
        }
        if (utilJs.goBindMobile(goPathQuery)) return true;
      }
    },
    activityBuy() {
      if (this.isActivityBuy()) return;
      // 点击立即购买
      this.goBuy();
    },
    lookEnrollMember() {
      // 点击查看更多
      this.$routerGo(this, "push", {
        path: "/member/scholarship/recordList",
        query: { from: this.from, activityId: this.mainId, rsId: this.rsId }
      });
    },
    spreadInvite() {
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      // 点击邀请好友
      // extId:对应的活动Id或者社群id或者测评id或者资料id
      //ckFrom 1：课程，2：专栏，3：测评，4：资料，5：社群，6：活动
      let activityId = this.mainId;
      this.$routerGo(this, "push", {
        path: "/homePage/spread/spreadCustom",
        query: {
          ckFrom: global.ckFrom.activity,
          cId: 0,
          extId: activityId
        }
      });
    },
    showGoPayTip() {
      this.$cjConfirm({
        title: '提示',
        message: '您已提交报名，还未付款！',
        cancelButtonText:'取消已有订单',
        confirmButtonText:'去付款',
        onConfirm:() => {
          this.onConfirm();
        },
        onCancel:() => {
          this.onCancel();
        }
      })
    },
    onCancel() {
      // 点击取消订单
      let $this = this;
      utilJs.postMethod(
        global.apiurl + "orders/orderCancel",
        { orderId: this.activityInfo.orderId },
        function (res) {
          if (res == "OK") {
            $this.getActivityInfo();
            // 成功改变状态
            $this.$showCjToast({
              text: "取消成功",
              type: "success",
              isShowMask: "true"
            });
          }
        }
      );
    },
    onConfirm() {
      // 点击去付款
      // 判断体验版是否到期，到期之后不可购买商品
      this.showExpire =
        utilJs.getTimeByDate(this.companyAuth.expireTime) -
        new Date().getTime() <
        0;
      if (this.showExpire) {
        return;
      }
      localStorage.setItem(
        "activityEnrollInfo",
        JSON.stringify({
          activityId: this.mainId,
          actTicketId: this.ticketId,
          infoArr: this.enrollInfo.infoArr,
          identCode: this.enrollInfo.identCode
        })
      );
      let goPathQuery = {
        cId: -1,
        extId: this.ticketId,
        ckFrom: this.enrollInfo.sales && (this.enrollInfo.sales.limit == 0 || this.enrollInfo.sales.balance > 0) ? this.cfrom.flashSalesActivity : this.cfrom.activity, // 活动进入支付页面
        isFromInvite: 0,
        isFromOrder: "TRUE",
        activityId: this.mainId,
        selectNum: this.enrollInfo.number,
        attendId: this.enrollInfo.tags == '4096' ? this.enrollInfo.attendId : '',
        collectPage: this.activityInfo.collectPage
      };
      if (this.enrollInfo.sales && (this.enrollInfo.sales.limit == 0 || this.enrollInfo.sales.balance > 0)) {
        goPathQuery.pId = this.enrollInfo.sales.pId;
      }
      // 拼团
      if (this.enrollInfo.tags == 2) {
        goPathQuery.cId = this.enrollInfo.groupId;
        goPathQuery.extId = this.enrollInfo.collageId;
        goPathQuery.prodId = this.enrollInfo.actTicketId;
        goPathQuery.ckFrom = global.ckFrom.collageActivity;
        if (this.enrollInfo.collageGroupType == 2) {
          goPathQuery.stepIndex = this.enrollInfo.stepIndex;
        }
      }
      if (this.goodsRoomId) {
        goPathQuery.goodsRoomId = this.goodsRoomId;
      }
      if (this.recType == 3 && this.recRelateId != '') {
        goPathQuery.recType = this.recType;
        goPathQuery.recRelateId = this.recRelateId;
        if (this.$route.query.refereeId) {
          goPathQuery.refereeId = this.$route.query.refereeId;
        }
      }

      this.$routerGo(this, "push", {
        path: "/homePage/course/coursePay",
        query: goPathQuery
      });
    },
    linkToTicketNum() {
      // 活动，跳转我的活动
      if (this.from == 'activity') {
        this.$routerGo(this, "push", {
          path: `/member/myActivity/myActivity`,
        });
      } else {
        this.$routerGo(this, "push", {
          path: "/activity/ticketNum",
          query: { activityId: this.mainId, from: 'reservation' }
        });
      }
    },
    clickLocation() {
      if (Number(this.activityInfo.lat) <= 0 && Number(this.activityInfo.lng) <= 0) {
        return;
      }
      let $this = this;
      wxUtilJs.openLocation({
        latitude: parseFloat($this.activityInfo.lat), // 纬度，浮点数，范围为90 ~ -90
        longitude: parseFloat($this.activityInfo.lng), // 经度，浮点数，范围为180 ~ -180。
        name: "", // 位置名
        address: $this.activityInfo.place, // 地址详情说明
        scale: 28, // 地图缩放级别,整形值,范围从1~28。默认为最大
        infoUrl: "" // 在查看位置界面底部显示的超链接,可点击跳转
      });
    },
    //获取邀请榜列表
    getInvLinkList() {
      utilJs.postMethod(global.apiurl + "activities/getInviteList", { activityId: this.mainId, pageIndex: 1, limit: 10 }, res => {
        this.myInvInfo = res.myRank;
        this.invLinkList = res.rank;
      });
    },
    clickShowInvLink() {
      this.getInvLinkList();
      this.showInvLink = true;
    },
    goInvite() {
      // 报名不在进行中状态，不能邀请
      if (this.activityInfo.status != 1) {
        return
      }
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      if (this.activityInfo.isInvitionCard == 1) {
        let activityId = this.mainId;
        this.$routerGo(this, "push", {
          path: "/homePage/spread/spreadCustom",
          query: {
            ckFrom: global.ckFrom.activity,
            cId: 0,
            extId: activityId
          }
        });
      } else {
        this.isShowShare = true;
      }
    },
    /*约课主题的接口在这里*/
    getYearByMonthCount(count) {
      if (this.companyAuth.enableDeclareModule == 1) {
        return ''
      }
      return utilJs.getYearByMonthCount(count)
    },
    closeOrderDate() {
      this.showOrderDate = false
      sessionStorage.removeItem(this.mainId + 'isFromOrderReservation')
    },
    getReservationDetail() { // 获取约课主题详情
      let $this = this;
      utilJs.getMethod(global.apiurl + "reservations/themeDetail?rtId=" + this.mainId + '&isSkeleton=1',
        function (res) {
          if (res.length <= 0) {
            $this.$routerGo($this, "replace", { path: "/error/emptyPage", query: { from: 'reservation', info: '找不到该主题了，请联系管理员！' } });
            return;
          }
          $this.activityInfo = res;
          $this.validAt = utilJs.dateFormat(res.validAt);
          var isFromOrder = sessionStorage.getItem($this.mainId + 'isFromOrderReservation');
          if (isFromOrder && isFromOrder == 1) { // 购买完弹出有效期
            $this.showOrderDate = true;
            $this.showDate = false;
          }
          if (res.isFriendHelper) { //友情灌溉
            let stime = $this.activityInfo ? utilJs.getTimeByDate($this.activityInfo.faStartAt) : 0;
            let etime = $this.activityInfo ? utilJs.getTimeByDate($this.activityInfo.faEndAt) : 0;
            let nowTime = (new Date()).getTime();
            //faStatus 1未开始,2进行中,3已结束,4已停止
            if (stime > nowTime) {
              $this.faStatus = 1;
            } else if (etime > nowTime) {
              $this.faStatus = 2;
            }
          } else if (res.sales != null && res.sales.status && (res.sales.limit == 0 || res.sales.balance > 0) && $this.companyAuth.enableFlashSalesModule == 1) {
            let nt = (new Date()).getTime();
            let st = utilJs.getTimeByDate(res.sales.sales.startTime);
            let et = utilJs.getTimeByDate(res.sales.sales.endTime);
            if (nt >= st && nt < et && $this.activityInfo.sales.sales.status > -1) {
              $this.isSales = true;
              $this.activityInfo.sales.sales.status = 2;
            } else if (nt < st && $this.activityInfo.sales.sales.status == 1) {
              $this.isSales = false;
              $this.activityInfo.sales.sales.status = 1;
            } else if (nt >= et && $this.activityInfo.sales.sales.status == 2) {
              $this.activityInfo.sales.sales.status = -1;
              $this.activityInfo.sales = null;
            } else {
              $this.activityInfo.sales = null;
            }
          } else {
            $this.activityInfo.sales = null;
          }
          $this.wechatShare();
          if ($this.activityInfo.sales && $this.activityInfo.sales.sales) {
            $this.isSalesBegin = ($this.activityInfo.sales.sales.startTime).replace(/\s+|[-]|[:]/g, "") <= (utilJs.getNowTime()).replace(/\s+|[-]|[:]/g, "") ? true : false;
          }
          $this.getRelevance();
          $this.getCommontList();
        }
      );
    },
    getBuyedPeople() { // 获取已购买的人员列表
      let $this = this;
      if ($this.dataStatus == 'LOADING') {
        return;
      }
      $this.dataStatus = 'LOADING';
      utilJs.getMethod(global.apiurl + 'reservations/getOrderList?rtId=' + $this.mainId + '&limit=10' + '&page=' + $this.pageIndex,
        (res) => {
          if ($this.pageIndex == 1) {
            $this.applyList = res.data;
          } else {
            $this.applyList = [...$this.applyList, ...res.data];
          }
          if (res.data && (res.data.length < 10)) {
            $this.dataStatus = $this.pageIndex == 1 && res.data.length == 0 ? 'NO_DATA' : 'NO_MORE_DATA';
          } else {
            $this.dataStatus = 'HAS_MORE_DATA';
            $this.pageIndex++;
          }
          $this.total = res.total
        }
      )
    },
    goToPay() { // 跳转支付页面
      if (this.bindPhoneSetting && this.bindPhoneSetting.buyBind) {
        let goPath = {};
        if (this.goodsRoomId) {
          goPath.goodsRoomId = this.goodsRoomId;
        }
        if (utilJs.goBindMobile(goPath)) return;
      }
      let pId = this.isSales ? this.activityInfo.sales.pId : null;
      let goPathQuery = {
        cId: 0,
        extId: this.mainId,
        prodId: this.mainId,
        ckFrom: this.isSales ? global.ckFrom.flashSalesReservation : global.ckFrom.reservation, // 约课主题进入支付页面
        isFromInvite: 0,
        pId: pId,
        collectPage: this.activityInfo.collectPage
      };
      if (this.goodsRoomId) {
        goPathQuery.goodsRoomId = this.goodsRoomId;
      }

      this.$routerGo(this, "push", {
        path: `/homePage/course/coursePay`,
        query: goPathQuery
      });
    },
    goToSectionInfo() { // 跳转场次信息页面
      this.$routerGo(this, "push", {
        path: '/homePage/reservation/sectionInfo',
        query: { rtId: this.mainId }
      });
    },
    goToInviteReservation() {
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      if (this.activityInfo.isInvitionCard == 1) { // 主题详情跳去邀请卡
        let q = { extId: this.mainId, ckFrom: global.ckFrom.reservation, cId: 0 };
        if (localStorage.getItem("shareholderId")) {
          q.shareholderId = localStorage.getItem("shareholderId");
        }
        this.$routerGo(this, "push", {
          path: "/homePage/spread/spreadCustom",
          query: q
        });
      } else {
        this.isShowShare = true;
      }
    },
    itemClick(obj) {
      this.getEnrollDateList(this.mainId, this.rsId, obj.date).then(res => {
        if (this.selectTime != '') {
          this.getCoachList(this.mainId, this.rsId, obj.date, this.selectTime);
        } else {
          this.coachList = [];
        }
      })
    },
    handleClickCoachSelect(item, index) {
      if (this.selectCoachIndex == index) {
        this.selectCoachIndex = -1;
        this.coachObject = null;
      } else {
        this.selectCoachIndex = index;
        this.coachObject = item;
      }
    },
    handleClickSelectTime(item, index) {
      this.selectTimeIndex = index;
      this.selectTime = item;
      if (this.selectTime != '') {
        this.getCoachList(this.mainId, this.rsId, this.localDate, item);
      } else {
        this.coachList = [];
      }
    },
    handleClickSelectCalendar(item, index) {
      this.getEnrollDateList(this.mainId, this.rsId, item.date).then(res => {
        if (this.selectTime != '') {
          this.getCoachList(this.mainId, this.rsId, item.date, this.selectTime);
        } else {
          this.coachList = [];
        }
      })
    },
    // 获取门店预约模式时间
    getEnrollDateList(rtId, rsId, date) {
      return new Promise((resolve, reject) => {
        utilJs.getMethod(global.apiurl + `reservations/getEnrollDateList?rtId=${rtId}&rsId=${rsId}&date=${date}`, res => {
          let dateArr = [];
          let nowDateStr = utilJs.dateFormat(+new Date());
          let curDate = new Date(nowDateStr.replace(/-/g, "/"));
          let nowWeek = curDate.getDay();
          this.localDate = date;
          this.weeked = weekMap[nowWeek];
          if (res.length > 0) {
            res.forEach((item, index) => {
              let itemDay = new Date(item.date).getDate();
              itemDay = itemDay < 10 ? `0${itemDay}` : itemDay;
              // 选中的日期
              if (date == item.date) {
                this.selectIndex = index;
                this.selectTimeIndex = 0
                if (item.enrollTimes.length > 0) {
                  item.enrollTimes.forEach((item, index) => {
                    if (index == this.selectTimeIndex) {
                      this.selectTime = item;
                      return;
                    }
                  })
                } else {
                  this.selectTime = '';
                }
                this.$refs.periods.handleScroll(index);
              }
              if (item.date == nowDateStr) {
                itemDay = '今';
              }
              let dateItem = {
                week: weekMap[item.week],
                date: item.date,
                enrollTimes: Object.values(item.enrollTimes),
                day: itemDay
              }
              dateArr.push(dateItem)
            });
          }
          this.myCalendarList = dateArr;
          resolve()
        }, () => {
          reject();
        })
      })
    },
    // 获取门店教练
    getCoachList(rtId, rsId, date, time) {
      utilJs.getMethod(global.apiurl + `reservations/getCoachList?rtId=${rtId}&rsId=${rsId}&date=${date}&time=${time}`, res => {
        this.coachList = res;
        if (res.length > 0) {
          res.forEach((item, index) => {
            if (index == this.selectCoachIndex) {
              this.coachObject = item;
            }
          })
        }
      })
    },
    /** 约课的场次详情接口在这里 */
    getSectionDetail() { // 场次详情
      let $this = this;
      utilJs.getMethod(global.apiurl + "reservations/getSessionDetail?rtId=" + this.mainId + '&rsId=' + this.rsId + '&isSkeleton=1',
        function (res) {
          if (res.length <= 0) { // 专场被下架 或删除
            var info = '找不到该专场了，请联系管理员！'
            $this.$routerGo($this, "replace", { path: "/error/emptyPage", query: { from: 'reservationSection', info: info } });
            return;
          }
          $this.activityInfo = res;
          $this.periodsList = res.phases;
          // 门店预约模式请求预约时间
          if (res.reservationMode == 1) {
            let nowDateStr = utilJs.dateFormat(+new Date());
            $this.getEnrollDateList($this.mainId, $this.rsId, nowDateStr).then(res => {
              if ($this.selectTime != '') {
                $this.getCoachList($this.mainId, $this.rsId, $this.localDate, $this.selectTime);
              } else {
                $this.coachList = [];
              }
            })
          }
          $this.getMyReservationList();
          $this.wechatShare();
        }
      );
    },
    getRePeople() { // 获取已预约的人员列表
      let $this = this;
      if ($this.dataStatus == 'LOADING') {
        return;
      }
      $this.dataStatus = 'LOADING';
      utilJs.getMethod(global.apiurl + 'reservations/getEnrollList?rtId=' + this.mainId + '&rsId=' + this.rsId + '&limit=10' + '&pageIndex=' + $this.pageIndex,
        (res) => {
          if (this.pageIndex == 1) {
            $this.applyList = res.data;
          } else {
            $this.applyList = [...$this.applyList, ...res.data];
          }
          if (res.data && (res.data.length < 10)) {
            $this.dataStatus = $this.pageIndex == 1 && res.data.length == 0 ? 'NO_DATA' : 'NO_MORE_DATA';
          } else {
            $this.dataStatus = 'HAS_MORE_DATA';
            $this.pageIndex++;
          }
          $this.total = res.total
        }
      )
    },
    goMyReservationList() {
      this.$routerGo(this, "push", {
        path: "/member/myReservation/myReservationList",
        query: {
          rtId: this.mainId,
        }
      })
    }
  },
  mounted() {
    this.weeked = '';
    this.localDate = '';
    this.selectIndex = 0;
    this.selectTimeIndex = 0;
    this.selectTime = '';
    this.myCalendarList = [];
    this.coachList = [];
    this.selectCoachIndex = 0;
    this.show = false;
    this.from = this.$route.query.from ? this.$route.query.from : 'activity';
    this.from == 'activity' ? setDocumentTitle("活动详情") : (this.from == 'reservation' ? setDocumentTitle("主题详情") : setDocumentTitle("专场详情"));// eslint-disable-line
    this.mainId = this.$route.query.ActivityNo;
    this.goodsRoomId = this.$route.query.goodsRoomId || '';
    this.refereeId = this.$route.query.refereeId || '';
    this.rsId = this.$route.query.rsId ? this.$route.query.rsId : '';
    // 改签过来的时候 会带reId rpId
    this.reId = this.$route.query.reId ? this.$route.query.reId : '';
    this.rpId = this.$route.query.rpId ? this.$route.query.rpId : '';
    this.selectCityIndex = this.$route.query.selectCityIndex || 0;
    this.recType = this.$route.query.recType || 0;//推荐类型 1 访问 2 绑定 3 支付
    this.recRelateId = this.$route.query.recRelateId || ""; //推荐人ID
    this.isShowTip = false;
    this.collage = null;
    this.activitySales = null;
    this.showShareMoneyTip = true;
    this.commission = 0;
    this.isShowShare = false;
    this.showExpire = false;
    this.activityInfo = {};
    this.showInvLink = false;
    this.invLinkList = [];
    this.periodsList = [];
    this.historyList = [];
    this.showHistoryDialog = false;
    this.enrollInfo = {};
    this.dataInfo = "";
    this.cloroRGB = THEME_RGB_MAP[this.theme];
    this.faStatus = 1;
    this.couponPage = 1;
    this.couponIsPage = false;
    this.couponLoading = false;
    this.showCoupon = false;
    this.couponList = [];
    this.isSales = false;
    this.retEnroll = "";
    this.guideInfo = "";
    this.marketingNum = 1;
    this.openModalPoster = false;
    this.showAccountQcode = false;
    this.officalDesc = '关注我们后才可发起砍价哦';
    this.mpQrcode = '';
    this.isCustServiceOpen = localStorage.getItem("isCustServiceOpen") == 1 ? true : false;
    this.isShowVerifyTip = false;
    if (this.from == 'activity' || this.from == 'reservation')
    {
      getBindPhoneSetting(this.from == 'activity' ? global.ckFrom.activity : global.ckFrom.reservation).then(res => {
        this.bindPhoneSetting = res;
      });
    } else {
      this.bindPhoneSetting = {
        buyBind: false,
        passwordBind: false,
        getBind: false,
        helpBind: false,
        enrollBind: false,
        commentBind: false,
        shareBind: false,
        collectBind: false,
        rewardBind: false
      };
    }
    if (this.from == 'activity') {
      this.getActivityInfo();
      this.getPerson();
      this.getRelevance();
      this.getCouponList();
      this.isRecommendPage() // 推荐有礼
    } else if (this.from == 'reservation') {
      this.getReservationDetail();
      this.getBuyedPeople();
      this.getRelevance();
      this.getCouponList();
    } else {
      this.getSectionDetail();
      this.getRePeople();
    }
  },
  destroyed() {
    this.show = false;
    this.collage = null;
    this.isShowShare = false;
    this.showExpire = false;
    this.activityInfo = {};
    this.showInvLink = false;
    this.invLinkList = [];
    this.applyList = [];
    this.total = 0
    this.dataStatus = 'HAS_MORE_DATA'
    this.pageIndex = 1
    this.relationData = [];
    this.periodsList = [];
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.refund {
  color: #ff683e;
}
.c-box-my-info {
  box-shadow: 0px 5px 20px 0px rgba(114, 189, 73, 0.2);
}
.img-rank-medal {
  width: 1.35rem;
}
.img-rank-medal img {
  width: 0.575rem;
  height: 0.95rem;
}
.invite-fixed-box {
  border-bottom-left-radius: 1.5rem;
  border-top-left-radius: 1.5rem;
  position: fixed;
  right: 0;
  background-color: #fff;
  box-shadow: 0 1px 5px 0 #0000001a;
  z-index: 10;
}
.chatroom-green-c {
  color: #72bd49;
}
.reservation-date-box {
  box-shadow: 0px 2px 6px 0px rgba(128, 128, 128, 0.3);
  transition: all 0.5s;
}
.c-ww530 {
  width: 13.25rem;
}
.c-ww590 {
  width: 14.75rem;
}
.hide-date {
  width: 14.75rem;
  animation: hideall 0.5s forwards;
}
@keyframes showall {
  to {
    width: 14.75rem;
  }
}
@keyframes hideall {
  to {
    width: 4.5rem;
  }
}
.history-box {
  box-shadow: 0px 0px 8px 1px rgba(35, 24, 21, 0.1);
}
.yqImg {
  width: 1rem;
  height: 0.8rem;
}
.enroll-number {
  background-color: #fa703d;
  color: white;
  border-radius: 0.325rem 0.3rem 0.3rem 0;
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.5rem;
  padding: 0.125rem 0.15rem;
  font-style: italic;
}
.yqAnimation {
  animation: yqAni 3s linear infinite;
  -webkit-animation: yqAni 3s linear infinite;
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  -ms-transform: translate3d(0, 0, 0);
  -o-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}
@keyframes yqAni {
  0% {
    width: 0.8rem;
  }
  8% {
    width: 0;
  }
  16% {
    width: 0.8rem;
  }
  100% {
    width: 0.8rem;
  }
}
.camp-guide-bg {
  background: url("../../assets/i/wap/course/group_guidance_bg.png") no-repeat;
  background-size: 100% 100%;
}
.camp-guide {
  color: #bcaa93;
  background: url("https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/camp/guide-tip.png") no-repeat;
  background-size: 100% 100%;
}
.pv1 {
  padding-top: 0.025rem;
  padding-bottom: 0.025rem;
}
.invite-animation {
  animation: yqAni 3s linear infinite;
  -webkit-animation: yqAni 3s linear infinite;
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  -ms-transform: translate3d(0, 0, 0);
  -o-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}
.c-bd-t0I{border-top: none!important;}
.moreMarket {
  background: linear-gradient(90deg,#ff625e 45%, #ffab56);
}
.closeBig >>> p > img,
.closeBig >>> section > img,
.closeBig >>> div > img,
.closeBig >>> img {
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -o-user-select: none;
  user-select: none;
}
.aCloseBig >>> p > a > img,
.aCloseBig >>> section > a > img,
.aCloseBig >>> div > a > img {
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -o-user-select: none;
  user-select: none;
}
.bg-lpink {background: rgba(246,65,99,0.10)}
.fc-pink {color: #F64163;}
.fc-3F73F8 {
  color: #3F73F8;
}
.start-activity-time-count{
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.7rem;
  background-image: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.6rem;
  color: #fff;
  font-size: 0.55rem;
}
.flatRecommend {
  background-image: url('https://ck-bkt-knowledge-payment.oss-cn-hangzhou.aliyuncs.com/admin/material/14_material_admin/image/public/images/example-images/activity/liveRecomme.png');
  background-size: 100%;
  background-repeat: no-repeat;
}
</style>


